Tools,

Marathi OCR: eleven free Tesseract runs, tested

96.7%

of letters, with mar best and no flags

Get the command

Use mar, not hin

We ran Tesseract 5.5.4 on 30 proofread Marathi pages from 10 books on mr.wikisource.

30 pages: letters and whole words right
Run Letters Words
mar best 96.7% 84.8%
mar best, Sauvola threshold 96.7% 84.7%
mar, tessdata repo 96.7% 84.7%
mar, tessdata repo, Sauvola 96.7% 84.7%
mar, tessdata repo, --psm 6 96.7% 84.9%
mar best, --psm 6 96.6% 84.9%
mar (fast) 96.6% 83.8%
script/Devanagari best 96.2% 82.6%
script/Devanagari 95.6% 80.8%
hin (Hindi) 95.0% 74.9%
mar+eng 92.3% 82.2%

The three mar files sit within 0.14 points. --psm 6 got up to 21 more words right, but fewer letters. Sauvola changed little.

Letters: proofread letters found in order. Words: whole words right.

The command: mar best, no flags

curl -LO https://raw.githubusercontent.com/tesseract-ocr/tessdata_best/4.1.0/mar.traineddata
mkdir -p tessdata && mv mar.traineddata tessdata/
tesseract page.png page --tessdata-dir tessdata -l mar

It writes page.txt. The 13.4 MB model took a median 6.2 s a page.

Homebrew's brew install tesseract-lang has the fast mar, a 2.1 MB file.

It read 96.6% of letters at 3.2 s a page, with one more word in a hundred wrong.

Fast mar's top slip: ल read as ळ

30 pages: mar best, top slips
Printed Read as Times
◌ं anusvara Nothing 70
ल la ळ lla 55
◌ु vowel sign u Nothing 23
ब ba व va 22
◌े vowel sign e Nothing 22

The fast mar did it 118 times, mar best 55.

The pages hold 250 ळ. The fast mar wrote 400, mar best 316.

hin has no ळ or ऱ

Our Actor ships Hindi but not Marathi. hin reads Devanagari, but its character set has no ळ, no ऱ and no ◌ॅ.

On our pages, 307 letters in 303 words could never come out right.

It wrote छ for ल 86 times and for ळ 42 times.

It read fewer letters than mar on 29 of 30 pages.

The eyelash ra and stray joiners

The proofread text writes the eyelash ra 42 times, always as ऱ् (U+0931 U+094D).

mar best wrote ऱ् 45 times, and twice as र्‍ with a hidden joiner. It got 33 of those 42 words right.

The pages hold no U+200C or U+200D. Every run wrote some anyway: the fast mar wrote U+200D 34 times. Delete both before you search.

Each book: 94.1% to 99.8%

Each book: letters found
Printed mar best hin
1911, red border 94.6% 92.8%
1911, cream paper 94.1% 91.7%
1956, brown paper 98.1% 97.1%
1970 96.9% 94.6%
1978 97.0% 96.0%
1979, small type 96.1% 94.6%
2009 99.8% 98.6%
No year, faint type 96.6% 92.5%
No year, a magazine study 94.6% 92.5%
No year 99.0% 98.6%

The two 1911 books and the magazine study read lowest. hin trailed mar best on every book.

A scanned PDF: the same model

mkdir -p tessdata
cp -r "$(brew --prefix)/share/tessdata/configs" tessdata/
curl -L -o tessdata/mar.traineddata \
  https://raw.githubusercontent.com/tesseract-ocr/tessdata_best/4.1.0/mar.traineddata
TESSDATA_PREFIX=$PWD/tessdata ocrmypdf -l mar --jobs 3 \
  --sidecar book.txt scan.pdf book.pdf

It took 78.0 s on our 30-page PDF.

The same text, read back five ways
From Letters in order Words
book.txt 96.8% 84.9%
book.pdf, pdftotext 93.9% 72.5%
book.pdf, pdftotext -raw 96.8% 72.8%
book.pdf, pdftotext -layout 96.2% 72.7%
book.pdf, PDFKit (macOS) 96.8% 84.9%

All five readers kept all 1,063 vowel signs i (ि). pdftotext lost about 12 points of words. Search book.txt.

Without the cp line, OCRmyPDF stopped with TesseractConfigError in our Bengali and Punjabi tests.

Five more things we checked

How we ran it
  • Pages marked proofread or validated on mr.wikisource, from a seeded shuffle of books, 3 a book. Pages with footnotes, tables or templates were left out.
  • The books were printed 1911 to 2009; 3 give no year. Every page is print. We looked at each one first.
  • 27 pages came from PDFs and 3 from a DjVu file, drawn 928 to 1,920 px wide.
  • Scores count Devanagari letters and signs. The danda, digits, punctuation, Latin letters and spaces are left out.
  • Letters found in order is the longest common subsequence. Slips come from a second alignment, so counts are close, not exact.
  • Models from tessdata_fast, tessdata_best and tessdata at tag 4.1.0. hin is the tessdata_fast file our Actor ships.
  • One thread a run, 3 runs at a time, at low priority, while other jobs ran. Times are rough.
  • OCRmyPDF 17.13.0, pdftotext from Poppler 26.03.0, PDFKit on macOS 26.6. The PDF holds the 30 scans as JPEGs, one a page.
  • Licenses: Tesseract and tessdata are Apache-2.0, OCRmyPDF is MPL-2.0. All 10 scan files are on Commons: 4 public domain, 6 CC BY-SA 4.0. We show no page images and quote no passage.

Scanned pages to text, no install

Run it yourself. Our Apify Actor turns a scanned PDF into Markdown or text. $0.006 a scanned page. It reads 18 languages, not Marathi.

Its Hindi model file, run alone on these pages: 95.0% of letters, 74.9% of words.

Try the Actor

Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free. For Marathi, ask first.

Get one page free

Questions people ask

Does Tesseract support Marathi?

Yes, with mar or script/Devanagari. On our 30 pages, mar best read 96.7% of letters and 84.8% of words with no flags.

Can I use the Hindi model for Marathi?

It reads most Devanagari letters, but it has no ळ or ऱ. On our pages, hin got 74.9% of words right, against 84.8% for mar best.

Which Tesseract model is best for Marathi?

mar best, by a hair: the three mar files sit within 0.14 points of letters. The fast mar takes about half the time and got about 1 point fewer words.

Can I OCR a Marathi PDF?

Yes. OCRmyPDF with -l mar (mar best) found 96.8% of letters and 84.9% of words on our 30-page PDF.

Why does Tesseract write ळ for ल?

We did not test why. On our pages, the fast mar did it 118 times and mar best 55 times.