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/doctr | Suryadatalab/surya | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 2 credits / page |
| Per 1,000 pages | $1.00 | $2.00 |
| Typical speed | 0.9 s / page | 1.5 s / page |
| Best for | Word-level OCR with positions | Layout and line-level OCR |
| Inputs | PDF, images | PDF, images |
| Languages | Mainly Latin scripts | 90+ languages |
| Max pages per request | 500 | 500 |
| Tables | No | ✓ Yes |
| Handwriting | No | No |
| Math | No | No |
| Bounding boxes | ✓ Yes | ✓ Yes |
| Confidence | ✓ Yes | 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 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
| docTR | Surya | |
|---|---|---|
| Licence | Apache-2.0 | Code 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 it | Python 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 |
| Price | Free, self-hosted (you pay for compute) | Free, self-hosted (you pay for compute); commercial licence needed above $5M revenue or funding |
| Output formats | JSON, plain text, bounding boxes | JSON, HTML, LaTeX, bounding boxes, plain text |
| Tables and math | No table, formula or Markdown output; words and lines only | HTML tables and KaTeX math. Surya 2.5 table output lacks row and column geometry, and multilingual tables score 58.1 |
| Benchmark | Not published | 83.7% on olmOCR-bench and 74.9% multilingual pass rate across 91 languages (author-reported); only 21 of 91 languages reach 90% |
| Known failure | Split-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 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": "mindee/doctr","fallbacks": ["datalab/surya"],"file_url": "https://example.com/document.pdf"}