TrOCR vs Surya
Pick Surya when you need to read whole pages or PDFs: it returns layout, reading order, tables and bounding boxes for 90+ languages in one model. Pick TrOCR when you already have cropped single text lines, mainly English handwriting, and want a small MIT-licensed recognizer you can fine-tune. The main split is scope: TrOCR reads one line image and nothing else, while Surya handles the full page.
TrOCRmicrosoft/trocr | Suryadatalab/surya | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 2 credits / page |
| Per 1,000 pages | $1.00 | $2.00 |
| Typical speed | 1.2 s / page | 1.5 s / page |
| Best for | Handwritten text lines | Layout and line-level OCR |
| Inputs | images | PDF, images |
| Languages | English | 90+ languages |
| Max pages per request | 100 | 500 |
| Tables | No | ✓ Yes |
| Handwriting | ✓ Yes | No |
| Math | No | No |
| Bounding boxes | No | ✓ Yes |
| Confidence | No | No |
| Forms | No | No |
| Multilingual | No | ✓ Yes |
| 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 TrOCR if
- You have English handwritten lines, where the large model reports 2.89 character error rate on IAM.
- You want to fine-tune a recognizer on your own line images, with separate checkpoints for handwritten (IAM), printed (SROIE) and scene text.
- You need a plain MIT license with no revenue cap, and a few lines of Hugging Face transformers code to load it.
Choose Surya if
- You need full-page OCR with layout labels, reading order, HTML tables and KaTeX math, each block with a bounding box.
- You work in many languages: it covers 90+ languages, while the TrOCR checkpoints are English-focused.
- You want to run locally on a laptop: llama.cpp works on CPU and Apple Silicon, with peak RAM of about 4-6 GB on an M4 Max.
Key differences
| TrOCR | Surya | |
|---|---|---|
| Input scope | Single text-line images only; you need a separate line detector | Full pages, with layout analysis and reading order |
| Output | Plain text | JSON, HTML, LaTeX, bounding boxes, plain text |
| Languages | Checkpoints are English-focused; other languages need fine-tuning | 90+ languages; 21 of 91 reach a 90% pass rate |
| Licence | MIT | Code Apache-2.0; weights under a modified AI Pubs Open Rail-M, free for research, personal use and companies under $5M funding/revenue |
| Running it | Local library via Hugging Face transformers | Lightweight client plus a separate vLLM or llama.cpp inference server |
| Model size | Base 334M, large 558M parameters | 689M parameters |
| Benchmark | 2.89 CER on IAM handwriting (large model, per the paper) | 83.7% on olmOCR-bench (Surya 2.5, per the authors) |
Sources
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
- microsoft/unilm repository
- Surya GitHub README
- Datalab pricing and license FAQ
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsSurya
Open-source OCR toolkit with line detection, layout analysis, reading order and tables.
Surya 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": "microsoft/trocr","fallbacks": ["datalab/surya"],"file_url": "https://example.com/document.pdf"}