naptha /tesseract.js

Pure Javascript OCR for more than 100 Languages 📖🎉🖥

★ 38,828⑂ 2,403👁 479⑃ 303● 742▤ 57◈ 26
JavaScriptApache-2.0Created 2015-06-24tesseract.projectnaptha.com/
38,828
stars
+1
2,403
forks
479
watchers
303
prs
742
issues
57
releases
26
discussions

README

!Lint & Test
!CodeQL
 
 



!npm
!jsDelivr hits (npm)

Tesseract.js is a javascript library that gets words in almost any language out of images. (Demo)

Image Recognition



Video Real-time Recognition


  


Tesseract.js works in the browser using webpack, esm, or plain script tags with a CDN and on the server with Node.js.
After you install it, using it is as simple as:

javascript
import { createWorker } from 'tesseract.js';

(async () = {
  const worker = await createWorker('eng');
  const ret = await worker.recognize('https://tesseract.projectnaptha.com/img/eng_bw.png');
  console.log(ret.data.text);
  await worker.terminate();
})();

When recognizing multiple images, users should create a worker once, run worker.recognize for each image, and then run worker.terminate() once at the end (rather than running the above snippet for every image). 

 Installation
Tesseract.js works with a  tag via local copy or CDN, with webpack via npm and on Node.js with npm/yarn.

 CDN
html



After including the script the Tesseract variable will be globally available and a worker can be created using Tesseract.createWorker.

Alternatively, an ESM build (used with import syntax) can be found at https://cdn.jsdelivr.net/npm/tesseract.js@5/dist/tesseract.esm.min.js. 

 Node.js

Tesseract.js v7 requires Node.js v16 or newer. (Tesseract.js v6 requires Node.js v14 or newer.)

shell
 For latest version
npm install tesseract.js
yarn add tesseract.js

 For old versions
npm install [email protected]
yarn add [email protected]


 Project Scope
Tesseract.js aims to bring the Tesseract OCR engine (a separate project) to the browser and Node.js, and works by wrapping a WebAssembly port of Tesseract.  This project does not modify core Tesseract features.  Most notably, Tesseract.js does not support PDF files and does not modify the Tesseract recognition model to improve accuracy.

If your project requires features outside of this scope, consider the Scribe.js library.  Scribe.js is an alternative library created to accommodate common feature requests that are outside of the scope of this repo.  Scribe.js includes improvements to the Tesseract recognition model and supports extracting text from PDF documents, among other features.  For more information see Scribe.js vs. Tesseract.js.

 Documentation

 Workers vs. Schedulers
 Examples
 Supported Image Formats
 API
 Local Installation
 FAQ

 Community Projects and Examples
The following are examples and projects built by the community using Tesseract.js. Officially supported examples are found in the examples directory. 

- Projects
   - Scribe OCR: web application for scanning documents (images and PDFs)
      - Site at scribeocr.com, repo at github.com/scribeocr/scribeocr
   - Chrome Extension (with Manifest V3): https://github.com/Tshetrim/Image-To-Text-OCR-extension-for-ChatGPT
- Examples
   - Converting PDF to text: https://github.com/racosa/pdf2text-ocr
   - Use blocks output to generate granular data [word/symbol lev

Top issues

Discussions

Latest release

v7.0.0 v7.0.0 2025-12-15
What's Changed
 Significant improvements to recognition speed (by @fanchenkong1 in https://github.com/naptha/tesseract.js/pull/1039)
    A new relaxedsimd build takes advantage of the latest WASM and hardware capabilities.
    Upgrading from v6 to v7 reduces runtimes by ~15-35% (depending on device and use-case).  The highest uplifts are currently seen on the latest Intel processors.
 Dropped support for Node.js v14.
 Various minor changes


 New Contributors
 @hata6502 made their first contribution in https://github.com/naptha/tesseract.js/pull/1035
 @fanchenkong1 made their first c

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON