TrOCR vs Granite Docling
Pick Granite Docling when you need to convert English PDFs with tables, code or equations into Markdown, HTML or LaTeX. Pick TrOCR when you already have cropped single-line images, especially English handwriting, and want to fine-tune a recognizer. The main split is scope: TrOCR reads one text line at a time, while Granite Docling converts whole pages.
TrOCRmicrosoft/trocr | Granite Doclingibm/granite-docling | |
|---|---|---|
| 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.5 s / page |
| Best for | Handwritten text lines | Small-model document conversion |
| Inputs | images | PDF, images |
| Languages | English | English, experimental CJK and Arabic |
| 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
- You have single text-line images of English handwriting, and the large model reports 2.89 character error rate on IAM.
- You want to fine-tune a recognizer on your own line images, starting from separate checkpoints for handwritten (IAM), printed (SROIE) and scene text.
- You want a small amount of code: it loads in a few lines with Hugging Face transformers under an MIT licence.
Choose Granite Docling if
- You need full-page conversion with tables, code and equations, and the model card reports table structure TEDS 0.97 on FinTabNet.
- You want structured output (DocTags, Markdown, HTML, LaTeX, bounding boxes) inside a Docling pipeline.
- You want a small model at 258M parameters under Apache-2.0, suited to low-cost CPU or small GPU conversion.
Key differences
| TrOCR | Granite Docling | |
|---|---|---|
| Input scope | Single text-line images only; you need a separate line detector. | Whole document pages, including tables, code and equations. |
| Output formats | Plain text. No layout, table or page-level output. | DocTags, Markdown, HTML, LaTeX and bounding boxes. |
| Model size | Base 334M, large 558M parameters. | 258M parameters. |
| Licence and price | MIT (microsoft/unilm repository). Free, self-hosted; you pay for compute. | Apache-2.0. Free, self-hosted; you pay for compute. |
| Benchmark | IAM handwriting CER 2.89 (TrOCR-large), per the paper. | Table TEDS 0.97 on FinTabNet, full-page OCR F1 0.84, equation F1 0.968. |
| Languages | Checkpoints are English-focused; other languages need fine-tuning. | English primary; Japanese, Arabic and Chinese are marked experimental. |
| Known failure | Slow on CPU compared with CRNN recognizers, despite reading one line. | Can get stuck in repetitive loops on page headings and invoices. On GPUs without bfloat16, such as T4, it may output only exclamation marks unless run in float32. |
Sources
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
- Granite-Docling model card
- HF discussion #24 repetition
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsGranite Docling
Compact IBM vision model that converts pages to DocTags for the Docling pipeline.
Granite Docling 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": ["ibm/granite-docling"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
TrOCR vs SmolDoclingTrOCR vs Qwen-VLolmOCR vs Granite DoclingKraken vs Granite DoclingDocling vs TrOCRTrOCR vs MiniCPM-V 4.5OCRmyPDF vs Granite DoclingGranite Docling vs Unstructured
TrOCR alternativesGranite Docling alternativesBest OCR models in 2026