Tools,

NDLOCR-Lite, tested on Japanese scans

98.8%

of characters found on vertical book pages

Install it in 4 commands

It beat Tesseract on 11 of 12 books

The free OCR of Japan's National Diet Library (NDL), on 45 book scans from 1905 to 2018, proofread on ja.wikisource.

Kanji and kana found, in order
Pages NDLOCR-Lite Tesseract
35 in columns 98.8% 81.6%
10 in lines 97.5% 61.6%

Tesseract ran the top model of my Nov 8 test for each layout: jpn_vert from tessdata_best for columns, the Japanese script model for lines. It won one book, a 2018 police report in modern type: 98.9% to 98.1%.

Proofread, a 1927 library report
大正十二年十一月一日より七日までを圖書館デーとして
NDLOCR-Lite
大正十二年十一月一日より七日までを圖書館デーとして
Tesseract
大正十二年ナ月一日より上日までを同誕館デーさして

It adds little junk

4.2% extra characters, NDLOCR-Lite

22.6% extra characters, Tesseract

On column pages, extra means kanji and kana it printed that are not in the proofread text: running heads, furigana and misreads.

NDLOCR-Lite printed one line twice, on 1 page of 45.

Normalize its text before you search

On 22 of 45 pages, it wrote kanji, mostly old forms, as compatibility characters, 91 in all: 者 as U+FA5B, 館 as U+FA2C.

On the sample page above, the proofread text has 圖書館 12 times. A search of NDLOCR-Lite's text found 7. After NFKC, it found all 12:

python3 -c "import sys,unicodedata;print(unicodedata.normalize('NFKC',sys.stdin.read()),end='')" < out/page.txt > page-nfkc.txt

NFKC also turns full-width letters and digits into plain ones.

Install it with Python 3.13

It runs on the CPU. On a Mac with uv:

git clone https://github.com/ndl-lab/ndlocr-lite
cd ndlocr-lite
uv tool install --python 3.13 .
ndlocr-lite --sourcedir scans --output out

Without that flag, uv picked Homebrew's Python 3.14 on my Mac and stopped: the onnxruntime pinned for Macs has no 3.14 wheel.

The clone holds the 4 models (157 MB), and the first run downloads them again from the NDL. Each image gets a .txt, a .json and an .xml file.

3.1 s a page, median

1.2 GiB peak memory

On 4 CPU threads of a Mac, in low-priority mode, not counting model load.

For PDFs, keep the .txt files

Give it --sourcepdf scan.pdf instead. It reads each page at 150 dpi and also writes scan_text.pdf, a copy with a text layer.

Characters in order, 2-page test PDF
Text from Columns Lines
.txt files 276 of 288 456 of 466
PDF layer (pdftotext) 189 of 288 456 of 466

The layer held 275 of the 288 characters, but pdftotext read the columns out of order, and wrote 、 and 。 as their vertical forms, ︑ and ︒.

Our Actor is the wrong tool here

Our pdf-ocr Actor on the Apify Store has one Japanese model, Tesseract's jpn. On these pages it found 67.2% on lines and 2.4% on columns. For Japanese scans, use NDLOCR-Lite.

Pages with their own text are free. A scanned page costs $0.006, and each run has a $0.00005 start fee at the default 1 GB.

See the Actor

How I tested it
  • The 45 pages of my Tesseract Japanese test, fetched again at the same proofread revision. Every page matched its Nov 8 character count, and Tesseract matched its Nov 8 score on all 90 runs.
  • NDLOCR-Lite 1.4.0 (Nov 11), its own models, default flags, 4 threads. The plain ndlocr-lite command gave the same text on a page I checked.
  • Score: kanji and kana only, in order, after NFKC. Punctuation, digits and Latin letters are left out. The Actor's code, build 0.1.106, ran on my Mac with language jpn.
  • --simple-mode True changed nothing: version 1.4.0 reads the flag but never uses it.
What I did not test
  • Handwriting. For version 1.2.1, the NDL reports a character error rate of 0.268 on 1,065 handwriting images.
  • Classical books (koten), such as woodblock prints. The NDL has NDL Koten OCR-Lite for those.
  • The desktop app, GPU mode and --enable-tcy.
Sources

Questions people ask

Is NDLOCR-Lite better than Tesseract for Japanese?

On our 45 book scans, yes. It found 98.8% of the characters on column pages and 97.5% on pages of lines. Tesseract's best free models found 81.6% and 61.6%.

Does NDLOCR-Lite need a GPU?

No. It runs on the CPU with onnxruntime. A GPU mode exists, marked beta.

What license does NDLOCR-Lite use?

CC BY 4.0, for the code and the models. Its README adds that the bundled layout model also falls under Meta's DINOv3 License.