Tools,

JavaScript OCR libraries, tested in Node

98.1%

of screenshot words, read by npm paddleocr

Get the code

Scans: system-ocr found the most

Ten scanned book pages, 1,955 words. Node 22 on a Mac, 2 threads each, but system-ocr has no thread setting.

Words found of 1,955
Library Words
system-ocr (Apple Vision) 1,931
paddleocr (PP-OCRv5) 1,908
Scribe.js 1,885
tesseract.js 1,876
ppu-paddle-ocr (PP-OCRv6 tiny) 1,851
Guten OCR (PP-OCRv4) 1,798

system-ocr calls Apple Vision on a Mac and Windows OCR on Windows, with no Linux build. Of the rest, paddleocr found the most.

Screenshots: tesseract.js came last overall

Words right of 3,876, on 32 screenshots
Library Right
paddleocr 98.1%
Scribe.js 97.1%
system-ocr 96.9%
ppu-paddle-ocr 95.2%
Guten OCR 89.0%
tesseract.js 87.3%

On the 1x chat shots of our screenshot test, tesseract.js got 52.5% of words right. The other five got 77.5% or more.

At 1x alone, Guten OCR was last: 80.0%, against 85.0% for tesseract.js.

The ONNX libraries weigh over 300 MB

Install size, and memory peak on the scans
Library Install Memory
system-ocr 0.9 MB 0.2 GB
tesseract.js 52 MB 0.4 GB
Scribe.js 74 MB 1.1 GB
paddleocr 341 MB 0.5 GB
ppu-paddle-ocr 354 MB 1.3 GB
Guten OCR 354 MB 3.1 GB

onnxruntime-node is 308 MB of each ONNX install. The tesseract.js and Scribe.js memory is for 2 workers.

tesseract.js: short, and runs anywhere

Save each example as page.mjs, next to page.jpg.

npm install tesseract.js
import { createWorker } from "tesseract.js";

const worker = await createWorker("eng");
const { data } = await worker.recognize("page.jpg");
console.log(data.text);
await worker.terminate();

paddleocr: bring your own models

npm install paddleocr onnxruntime-node sharp yaml
for m in PP-OCRv5_mobile_det_onnx en_PP-OCRv5_mobile_rec_onnx; do
  mkdir -p $m
  for f in inference.onnx inference.yml; do
    curl -fsSL -o $m/$f https://huggingface.co/PaddlePaddle/$m/resolve/main/$f
  done
done

Then read the page

import fs from "node:fs";
import * as ort from "onnxruntime-node";
import { PaddleOcrService } from "paddleocr";
import sharp from "sharp";
import YAML from "yaml";

const DET = "PP-OCRv5_mobile_det_onnx";
const REC = "en_PP-OCRv5_mobile_rec_onnx";
const model = (dir) => new Uint8Array(fs.readFileSync(`${dir}/inference.onnx`)).buffer;
const yml = YAML.parse(fs.readFileSync(`${REC}/inference.yml`, "utf8"));
// paddleocr has no thread option, so cap ONNX Runtime here
const create = (m, o) => ort.InferenceSession.create(m, { ...o, intraOpNumThreads: 2 });

const ocr = await PaddleOcrService.createInstance({
  ort: { ...ort, InferenceSession: { create } },
  modelPreset: "PP-OCRv5_mobile",
  detection: { modelBuffer: model(DET) },
  recognition: {
    modelBuffer: model(REC),
    charactersDictionary: yml.PostProcess.character_dict,
  },
});
const img = await sharp("page.jpg").removeAlpha().raw().toBuffer({ resolveWithObject: true });
const result = await ocr.recognize({ ...img.info, data: img.data });
console.log(ocr.processRecognition(result).text);
await ocr.destroy();

ppu-paddle-ocr: PP-OCRv6, with one catch

npm install ppu-paddle-ocr onnxruntime-node
import fs from "node:fs";
import { PaddleOcrService } from "ppu-paddle-ocr";

const ocr = new PaddleOcrService({ session: { intraOpNumThreads: 2 } });
await ocr.initialize();
// a string must be a URL or start with "/", so pass the bytes
const b = fs.readFileSync("page.jpg");
const result = await ocr.recognize(b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength));
console.log(result.text);
await ocr.destroy();

system-ocr: the OS does the reading

npm install @napi-rs/system-ocr
import { recognize } from "@napi-rs/system-ocr";

const result = await recognize("page.jpg");
console.log(result.text);

Scribe.js and Guten OCR

Or call our Actor from JavaScript

Our Apify Actor, PDF to Markdown OCR, reads scans and images by URL:

npm install apify-client
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("brasspage/pdf-ocr-to-markdown").call({
  documentUrls: ["https://example.com/scan.pdf"],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const doc of items) console.log(doc.markdown);
How I tested, and what I skipped
  • A Mac with Apple M5 Max, macOS 26.6, Node 22.22.2.
  • The scans: 10 proofread pages from two public domain books on Wikisource, 1920 px JPEGs. Score: true words found in order.
  • The screenshots: 16 scenes drawn in Chromium at 1x and 2x. Score: words right, in any order.
  • One library at a time, at low priority. The ONNX libraries had intraOpNumThreads at 2.
  • tesseract.js and Scribe.js ran 2 workers, 2 pages at once.
  • No times: every run was at background priority on a busy Mac. tesseract.js took 7.9 s a page here, 1.8 s in our Scribe.js guide.
  • Our Scribe.js guide found 1,894 to 1,895 words with 0.18.2, from the same pages in a PDF.
  • Scripts and results stay in our private repo, in research/bench/javascript-ocr-2026-11-25/.
Package Version
tesseract.js 7.0.0
scribe.js-ocr 0.18.3
paddleocr 1.2.1
ppu-paddle-ocr 6.7.1
@gutenye/ocr-node 1.4.9
@napi-rs/system-ocr 1.2.0
onnxruntime-node 1.31.1
apify-client 2.26.0

What I did not test

  • Browsers. tesseract.js, Scribe.js, paddleocr, ppu-paddle-ocr and Guten OCR say they run there too.
  • Linux, Windows, GPUs and the CoreML provider.
  • Languages other than English, and PDFs.
  • @qvac/ocr-ggml, and the official @paddleocr/paddleocr-js.

Questions people ask

What is the best OCR library for JavaScript?

In our Node test, paddleocr with PP-OCRv5 models got the most screenshot words right, 98.1%. On scans, system-ocr found the most on a Mac, with Apple Vision. I did not test Windows.

Is tesseract.js accurate?

On our scans it was fourth of six: 1,876 of 1,955 words. On screenshots it was last of six overall, with 87.3% of words right.

Can JavaScript OCR run in the browser?

tesseract.js, Scribe.js, paddleocr, ppu-paddle-ocr and Guten OCR (as @gutenye/ocr-browser) say they can. I tested Node only.

Does tesseract.js read PDFs?

No, its README says so. Scribe.js reads PDFs, and so does our Actor.