OCRRouter

TrOCR vs olmOCR

Pick olmOCR for full PDFs and mixed printed and handwritten pages that need Markdown out, and plan for an NVIDIA GPU with at least 12 GB VRAM. Pick TrOCR only when you already have cropped single text-line images, such as English handwritten lines or receipt lines, or want to fine-tune a recognizer on your own line data. The main split is scope: TrOCR reads one line at a time, olmOCR reads whole pages.

TrOCRmicrosoft/trocrolmOCRallenai/olmocr
TypeOpen sourceOpen source
Price1 credit / page2 credits / page
Per 1,000 pages$1.00$2.00
Typical speed1.2 s / page1.5 s / page
Best forHandwritten text linesBulk PDF to text for datasets
InputsimagesPDF, images
LanguagesEnglishMainly English
Max pages per request1001,000
TablesNo✓ Yes
Handwriting✓ Yes✓ Yes
MathNo✓ Yes
Bounding boxesNoNo
ConfidenceNoNo
FormsNoNo
MultilingualNoNo
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 TrOCR if

  • You have single text-line images and a separate line detector, and you only need plain text back.
  • You want English handwriting recognition: the paper reports 2.89 character error rate on IAM with the large model.
  • You want to fine-tune a recognizer, or run on a small setup: the base model is 334M parameters, it loads in a few lines with Hugging Face transformers, and it is MIT licensed.

Choose olmOCR if

  • You need whole PDFs or images turned into Markdown or JSON, with equations, tables and handwriting handled and headers and footers stripped.
  • You process pages at volume: self-hosting costs under $200 per million pages per Ai2, or you can call hosted olmOCR-2-7B on DeepInfra at $0.09 input and $0.19 output per million tokens.
  • You want an open toolkit with a published benchmark score: 82.4 on olmOCR-Bench, with weights, training data and code released under an Apache-2.0 toolkit licence.

Key differences

TrOCRolmOCR
Input scopeSingle text-line images only. No layout, table or page-level output.Full PDFs and images, converted to Markdown in natural reading order.
OutputPlain textMarkdown or JSON
How you run itLocally through Hugging Face transformers. Base 334M, large 558M parameters.Self-host with vLLM on an NVIDIA GPU (12 GB VRAM minimum, 30 GB free disk), or use third-party hosted endpoints. 7B parameters.
PriceFree, self-hosted. You pay for compute.Self-hosted: under $200 per million pages. Hosted on DeepInfra: $0.09 input / $0.19 output per million tokens.
LicenceMITApache-2.0 (toolkit)
Benchmark2.89 CER on IAM handwriting (TrOCR-large, from the paper)82.4 on olmOCR-Bench (v0.4.0), above Marker (76.1), MinerU 2.5.4 (75.2) and Mistral OCR (72.0)
Languages and known failuresReleased checkpoints are English-focused. Other languages need fine-tuning. Slow versus CRNN recognizers on CPU.Out of memory on a 12 GB GPU (issue #424), gets stuck on the last pages (issue #433), unreliable image bounding box coordinates (issue #437). Not for CPU-only machines.

Sources

What each one is

TrOCR

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

TrOCR details

olmOCR

Open-source vision model from Ai2 (often searched as olm ocr) that turns PDFs into clean, reading-order text. Latest release: olmOCR 2.

olmOCR 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": "microsoft/trocr","fallbacks": ["allenai/olmocr"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

TrOCR alternativesolmOCR alternativesBest OCR models in 2026