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/ocrmypdf | TrOCRmicrosoft/trocr | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 1 credit / page |
| Per 1,000 pages | $1.00 | $1.00 |
| Typical speed | 1.0 s / page | 1.2 s / page |
| Best for | Searchable PDFs from scans | Handwritten text lines |
| Inputs | PDF, images | images |
| Languages | 100+ languages (via Tesseract) | English |
| Max pages per request | 1,000 | 100 |
| Tables | No | No |
| Handwriting | No | ✓ Yes |
| Math | No | No |
| Bounding boxes | No | No |
| Confidence | No | No |
| Forms | No | No |
| Multilingual | ✓ Yes | No |
| On OCRRouter | Available | Available |
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
| OCRmyPDF | TrOCR | |
|---|---|---|
| Input | Scanned PDFs, whole documents | Single text-line images only, so you need a separate line detector |
| Output | Searchable PDF/A and plain text | Plain text only, no layout, table or page-level output |
| Handwriting | Not suited to handwriting | Handwritten checkpoint, 2.89 CER on IAM (large, per the paper) |
| Languages | 100+ via Tesseract language packs | Released checkpoints are English-focused; other languages need fine-tuning |
| Licence | MPL-2.0 | MIT (microsoft/unilm repository) |
| Hardware and speed | CPU only, parallel across all cores | Base 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
- OCRmyPDF GitHub README
- Issue #1790 form fields
- Issue #948 file size
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
What each one is
OCRmyPDF
Command-line tool that adds a searchable text layer to scanned PDFs, using Tesseract.
OCRmyPDF detailsTrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsTry 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 vs olmOCROCRmyPDF vs KrakenRapidOCR vs TrOCREasyOCR vs TrOCRTrOCR vs DonutTrOCR vs MiniCPM-V 4.5OCRmyPDF vs GOT-OCR 2.0Unlimited OCR vs OCRmyPDF
OCRmyPDF alternativesTrOCR alternativesBest OCR models in 2026