TrOCR vs SmolDocling
Pick SmolDocling if you need to convert whole English pages with tables, code and formulas into Markdown, HTML or JSON, and treat it as an experiment because it is a preview release. Pick TrOCR if you already have cropped single text lines, especially English handwriting, and want a recognizer you can fine-tune. TrOCR reads one line at a time and has no layout output, while SmolDocling reads full pages.
TrOCRmicrosoft/trocr | SmolDoclinghuggingface/smoldocling | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 1 credit / page |
| Per 1,000 pages | $1.00 | $1.00 |
| Typical speed | 1.2 s / page | 1.0 s / page |
| Best for | Handwritten text lines | Very cheap page conversion |
| Inputs | images | PDF, images |
| Languages | English | Mainly English |
| Max pages per request | 100 | 500 |
| Tables | No | ✓ Yes |
| Handwriting | ✓ Yes | No |
| Math | No | ✓ Yes |
| Bounding boxes | No | ✓ Yes |
| Confidence | No | No |
| Forms | No | No |
| Multilingual | No | No |
| 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
- It reports 2.89 character error rate on the IAM handwriting set with the large model, per the paper.
- It ships separate checkpoints fine-tuned for handwritten (IAM), printed (SROIE) and scene text, so you can start from the closest one and fine-tune on your own line images.
- It loads in a few lines with Hugging Face transformers and is under the MIT license.
Choose SmolDocling if
- It converts a whole page in one pass and handles text, tables, code, formulas and charts with location tags.
- It outputs DocTags, Markdown, HTML, JSON, LaTeX and bounding boxes, so Docling can use the result directly.
- At 256M parameters it runs on modest hardware, and it takes about 0.35 seconds per page on an A100 with vLLM.
Key differences
| TrOCR | SmolDocling | |
|---|---|---|
| Input scope | Single text-line images only; you need a separate line detector | Full pages, with text, tables, code, formulas and charts |
| Output | Plain text | DocTags, Markdown, HTML, JSON, LaTeX, bounding boxes |
| Size | Base 334M, large 558M parameters | 256M parameters |
| Licence | MIT (microsoft/unilm repository) | Apache-2.0 per model summary (metadata tag says CDLA-Permissive-2.0) |
| Languages | English-focused checkpoints; other languages need fine-tuning | English only |
| Reported accuracy | IAM handwriting CER 2.89 (large) | Table TEDS 0.82 on FinTabNet, full-page OCR F1 0.80 |
| Known failure | Slow on CPU versus CRNN recognizers; no layout or table output | Output can loop with endless token repetition or missing closing tags; preview release, superseded by Granite-Docling |
Sources
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
- SmolDocling model card
- Docling issue #1515
- Granite-Docling comparison table
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsSmolDocling
Tiny 256M vision model from Hugging Face and IBM that outputs DocTags. Predecessor of Granite Docling.
SmolDocling detailsTry both on your own file
Run the file once with each model and compare the output.
Use one, fall back to the other
{"model": "microsoft/trocr","fallbacks": ["huggingface/smoldocling"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
TrOCR alternativesSmolDocling alternativesBest OCR models in 2026