OCRRouter

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/trocrGranite Doclingibm/granite-docling
TypeOpen sourceOpen source
Price1 credit / page1 credit / page
Per 1,000 pages$1.00$1.00
Typical speed1.2 s / page1.5 s / page
Best forHandwritten text linesSmall-model document conversion
InputsimagesPDF, images
LanguagesEnglishEnglish, experimental CJK and Arabic
Max pages per request100500
TablesNo✓ Yes
Handwriting✓ YesNo
MathNo✓ Yes
Bounding boxesNo✓ Yes
ConfidenceNoNo
FormsNoNo
MultilingualNoNo
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 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

TrOCRGranite Docling
Input scopeSingle text-line images only; you need a separate line detector.Whole document pages, including tables, code and equations.
Output formatsPlain text. No layout, table or page-level output.DocTags, Markdown, HTML, LaTeX and bounding boxes.
Model sizeBase 334M, large 558M parameters.258M parameters.
Licence and priceMIT (microsoft/unilm repository). Free, self-hosted; you pay for compute.Apache-2.0. Free, self-hosted; you pay for compute.
BenchmarkIAM 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.
LanguagesCheckpoints are English-focused; other languages need fine-tuning.English primary; Japanese, Arabic and Chinese are marked experimental.
Known failureSlow 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

What each one is

TrOCR

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

TrOCR details

Granite Docling

Compact IBM vision model that converts pages to DocTags for the Docling pipeline.

Granite Docling 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": ["ibm/granite-docling"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

TrOCR alternativesGranite Docling alternativesBest OCR models in 2026