OCRRouter

OCRmyPDF vs TrOCR

Pick OCRmyPDF to make scanned PDFs searchable and archive-ready as PDF/A on CPU. Pick TrOCR to read single line images, mainly English handwriting, or to fine-tune a recognizer on your own line crops. They solve different problems: OCRmyPDF takes whole PDFs, TrOCR only takes one text line at a time.

OCRmyPDFocrmypdf/ocrmypdfTrOCRmicrosoft/trocr
TypeOpen sourceOpen source
Price1 credit / page1 credit / page
Per 1,000 pages$1.00$1.00
Typical speed1.0 s / page1.2 s / page
Best forSearchable PDFs from scansHandwritten text lines
InputsPDF, imagesimages
Languages100+ languages (via Tesseract)English
Max pages per request1,000100
TablesNoNo
HandwritingNo✓ Yes
MathNoNo
Bounding boxesNoNo
ConfidenceNoNo
FormsNoNo
Multilingual✓ YesNo
On OCRRouterAvailableAvailable

Prices are what you pay on OCRRouter. Speed is the provider's typical figure, not a benchmark we ran.

Which to choose

Choose OCRmyPDF if

  • It takes a scanned PDF and returns a validated searchable PDF/A, so it fits archiving and compliance workflows.
  • It runs on CPU only and spreads work across all cores, with no GPU needed.
  • It uses Tesseract, so language packs cover 100+ languages.

Choose TrOCR if

  • It reports a 2.89 character error rate on the IAM handwriting set with the large model, per the paper.
  • It has separate checkpoints fine-tuned for handwritten (IAM), printed (SROIE) and scene text, and you can fine-tune it on custom line images.
  • It loads in a few lines with Hugging Face transformers and is MIT licensed.

Key differences

OCRmyPDFTrOCR
InputScanned PDFs, whole documentsSingle text-line images only, so you need a separate line detector
OutputSearchable PDF/A and plain textPlain text only, no layout, table or page-level output
HandwritingNot suited to handwritingHandwritten checkpoint, 2.89 CER on IAM (large, per the paper)
Languages100+ via Tesseract language packsReleased checkpoints are English-focused; other languages need fine-tuning
LicenceMPL-2.0MIT (microsoft/unilm repository)
Hardware and speedCPU only, parallel across all coresBase 334M and large 558M parameters; slow versus CRNN recognizers on CPU
Known failure--skip-text with default PDF/A output removes form fields (issue #1790); file size can grow 2x to 4x with --deskew --clean-final (issue #948)Fails on full pages, since it only reads one line at a time

Sources

What each one is

OCRmyPDF

Command-line tool that adds a searchable text layer to scanned PDFs, using Tesseract.

OCRmyPDF details

TrOCR

Transformer text recognition model. Reads single text lines, including handwriting.

TrOCR details

Try both on your own file

Run the file once with each model and compare the output.

PDF, PNG, JPG, WebP, HEIC. Up to 20 MB each, 10 files.No file?

Use one, fall back to the other

{"model": "ocrmypdf/ocrmypdf","fallbacks": ["microsoft/trocr"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

OCRmyPDF alternativesTrOCR alternativesBest OCR models in 2026