easyocr.js
easyocr.js is the first complete JavaScript/TypeScript port of EasyOCR. It reimplements the whole pipeline (image preprocessing, CRAFT text detection, CRNN recognition, CTC decoding) and runs it on ONNX Runtime, so it needs no Python and spawns no Python processes.
Compared with Python-based EasyOCR wrappers
This comparison is specifically with JavaScript packages that call EasyOCR’s Python implementation. It does not describe JavaScript OCR libraries generally: for example, Tesseract.js runs in browsers and Node.js using WebAssembly.
| Python-backed EasyOCR wrapper | easyocr.js | |
|---|---|---|
| Implementation | Calls EasyOCR’s Python implementation | Native JavaScript/TypeScript port |
| Python at runtime | Required | Not required |
| Inference | EasyOCR’s Python runtime | ONNX Runtime in Node.js or the browser |
Features
- Same accuracy as Python: Outputs match the Python reference implementation, checked by validating and tracing each pipeline stage.
- Same models: Uses the original CRAFT detector and recognition models, with 80+ languages including English, Chinese, Japanese, and Korean.
- Node.js and browser: Node uses
sharpandonnxruntime-node; the browser usesonnxruntime-weband Canvas. The core has no runtime-specific dependencies. - CPU/GPU acceleration: Through ONNX Runtime, with no platform-specific bindings.
- No Python: No interpreter, virtual environment, or pip packages to install.
- Runs client-side: In the browser, documents never leave the machine.
- TypeScript: Fully typed.
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.