easyocr.js

The first complete native JavaScript port of EasyOCR — not a wrapper, but a full native implementation with zero Python dependencies.

easyocr.js is the first complete native JavaScript/TypeScript implementation of EasyOCR — not a wrapper that spawns Python processes, but a full port of the entire OCR pipeline from image preprocessing to CRAFT text detection, CRNN recognition, and CTC decoding. It runs entirely in JavaScript environments using ONNX Runtime with zero Python dependencies.

Why easyocr.js?

Unlike other JS OCR libraries that wrap Python processes:

Other JS OCR Librarieseasyocr.js
ArchitecturePython wrapper (spawns child processes)Native JavaScript implementation
Python RequiredYes (Python 3.6+, pip, venv)No
Browser SupportNode.js onlyNode.js + Browser
PerformanceProcess spawn overheadDirect ONNX inference
DeploymentComplex (Python + Node)Simple npm install

Key Strengths

  • 🥇 First True JS Port: The first complete native JavaScript/TypeScript implementation of EasyOCR — from image preprocessing to CRAFT detection and CRNN recognition.
  • 📊 Numerical Parity: Achieves equivalent accuracy to the Python reference implementation through comprehensive validation and tracing.
  • 🌐 Universal Runtime: Works seamlessly in both Node.js and the Browser using runtime-agnostic core logic.
  • ⚡ Hardware Acceleration: Leverages ONNX Runtime for CPU/GPU acceleration without platform-specific bindings.
  • 📦 Zero Python Dependencies: Deploy anywhere JavaScript runs — no Python installation, virtual environments, or pip packages required.
  • 🎯 Model Compatible: Uses the same CRAFT detector and recognition models as the original Python EasyOCR (80+ languages supported).
  • 🔧 TypeScript First: Full type safety, modular architecture, and modern JavaScript patterns throughout.

Features

  • Multi-runtime Support: Works seamlessly in Node.js (via sharp and onnxruntime-node) and the Browser (via onnxruntime-web and Canvas).
  • High Performance: Direct ONNX inference with hardware acceleration (CPU/GPU).
  • Multi-language: Supports 80+ languages including English, Chinese, Japanese, Korean, and more.
  • Lightweight Core: Core logic is decoupled from runtime-specific dependencies.
  • Privacy-First: Client-side OCR means sensitive documents never leave the browser.

Quick Start

# Node.js
npm install @qduc/easyocr-node @qduc/easyocr-core

# Browser
npm install @qduc/easyocr-web @qduc/easyocr-core

Tech Stack

  • TypeScript
  • ONNX Runtime
  • Sharp (Node.js)
  • Canvas API (Browser)

Learn more in the GitHub repository.