OCRRouter

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/trocrSuryadatalab/surya
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 linesLayout and line-level OCR
InputsimagesPDF, images
LanguagesEnglish90+ languages
Max pages per request100500
TablesNo✓ Yes
Handwriting✓ YesNo
MathNoNo
Bounding boxesNo✓ Yes
ConfidenceNoNo
FormsNoNo
MultilingualNo✓ Yes
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 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

TrOCRSurya
Input scopeSingle text-line images only; you need a separate line detectorFull pages, with layout analysis and reading order
OutputPlain textJSON, HTML, LaTeX, bounding boxes, plain text
LanguagesCheckpoints are English-focused; other languages need fine-tuning90+ languages; 21 of 91 reach a 90% pass rate
LicenceMITCode Apache-2.0; weights under a modified AI Pubs Open Rail-M, free for research, personal use and companies under $5M funding/revenue
Running itLocal library via Hugging Face transformersLightweight client plus a separate vLLM or llama.cpp inference server
Model sizeBase 334M, large 558M parameters689M parameters
Benchmark2.89 CER on IAM handwriting (large model, per the paper)83.7% on olmOCR-bench (Surya 2.5, per the authors)

Sources

What each one is

TrOCR

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

TrOCR details

Surya

Open-source OCR toolkit with line detection, layout analysis, reading order and tables.

Surya 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": ["datalab/surya"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

TrOCR alternativesSurya alternativesBest OCR models in 2026