OCRRouter

docTR vs Surya

Pick docTR if you want word-level OCR with coordinates in Python and plan to train or tune your own models, for example on invoices and receipts. Pick Surya if you need layout, reading order, tables or math from one model, or want to run locally on a laptop. The main split is output: docTR returns words and lines only, while Surya returns layout labels, HTML tables and KaTeX math.

docTRmindee/doctrSuryadatalab/surya
TypeOpen sourceOpen source
Price1 credit / page2 credits / page
Per 1,000 pages$1.00$2.00
Typical speed0.9 s / page1.5 s / page
Best forWord-level OCR with positionsLayout and line-level OCR
InputsPDF, imagesPDF, images
LanguagesMainly Latin scripts90+ languages
Max pages per request500500
TablesNo✓ Yes
HandwritingNoNo
MathNoNo
Bounding boxes✓ Yes✓ Yes
Confidence✓ YesNo
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 docTR if

  • You want a plain Python library on PyTorch with no separate inference server to run.
  • You need a nested page, block, line and word structure with coordinates as JSON, with straight or rotated boxes.
  • Your licence must be Apache-2.0 with no revenue limit, since Surya's weights are not.

Choose Surya if

  • You need layout detection, reading order and HTML table output, which docTR does not produce.
  • You need math as KaTeX or LaTeX output, or text in 90+ languages.
  • You want to run on CPU or Apple Silicon through llama.cpp, with peak memory of about 4.3 to 5.9 GB on an M4 Max.

Key differences

docTRSurya
LicenceApache-2.0Code Apache-2.0; weights under a modified AI Pubs Open Rail-M, free for research, personal use and companies under $5M funding or revenue
How you run itPython library on PyTorch, with Docker images; CPU or NVIDIA GPU (GPU images need CUDA 12.2 or newer)Light client against a vLLM or llama.cpp server you run yourself; NVIDIA GPU via vLLM, or CPU and Apple Silicon via llama.cpp
PriceFree, self-hosted (you pay for compute)Free, self-hosted (you pay for compute); commercial licence needed above $5M revenue or funding
Output formatsJSON, plain text, bounding boxesJSON, HTML, LaTeX, bounding boxes, plain text
Tables and mathNo table, formula or Markdown output; words and lines onlyHTML tables and KaTeX math. Surya 2.5 table output lacks row and column geometry, and multilingual tables score 58.1
BenchmarkNot published83.7% on olmOCR-bench and 74.9% multilingual pass rate across 91 languages (author-reported); only 21 of 91 languages reach 90%
Known failureSplit-crop merging misjoins readings across repeated characters (issue #2229); cropped images give poorer results (issue #2007); ONNX export of MASTER truncates decoding steps (issue #2224)Not for handwriting, complex multilingual tables or photos of natural scenes; the README sends hard documents to the hosted Datalab API

Sources

What each one is

docTR

Open-source OCR library from Mindee with separate text detection and recognition models.

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

Questions

More comparisons

docTR alternativesSurya alternativesBest OCR models in 2026