OCRRouter

Docling vs TrOCR

Pick Docling to turn whole documents (PDF, DOCX, PPTX, XLSX, HTML, images) into structured Markdown or JSON, for example RAG ingestion of born-digital files. Pick TrOCR to read single cropped text-line images, mainly English handwriting or receipt lines. They are not substitutes: TrOCR reads one line and has no layout, so you need a line detector in front of it, while Docling works at page level but leaves scan accuracy to the OCR engine you plug in.

Doclingibm/doclingTrOCRmicrosoft/trocr
TypeOpen sourceOpen source
Price2 credits / page1 credit / page
Per 1,000 pages$2.00$1.00
Typical speed2.2 s / page1.2 s / page
Best forStructured export for RAGHandwritten text lines
InputsPDF, images, DOCXimages
LanguagesLatin scripts, CJKEnglish
Max pages per request500100
Tables✓ YesNo
HandwritingNo✓ Yes
Math✓ YesNo
Bounding boxes✓ YesNo
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 Docling if

  • You need one API for PDF, DOCX, PPTX, XLSX, HTML, EPUB, images, emails and XBRL.
  • You want structured output (Markdown, HTML, JSON, DocTags, plain text), with lossless JSON that keeps layout, reading order and table structure.
  • You want to plug in an OCR backend (EasyOCR, Tesseract, RapidOCR) or the 258M GraniteDocling VLM, and feed LangChain or LlamaIndex pipelines.

Choose TrOCR if

  • You need to read English handwritten lines: the large model reports 2.89 character error rate on the IAM handwriting set, per the paper.
  • You want separate checkpoints fine-tuned for handwritten (IAM), printed (SROIE) and scene text, or want to fine-tune a recognizer on your own line images.
  • You want a small amount of code: it loads in a few lines with Hugging Face transformers, with an MIT licence.

Key differences

DoclingTrOCR
Input scopeWhole documents: PDF, DOCX, PPTX, XLSX, HTML, EPUB, images, emails, XBRLSingle text-line images only; needs a separate line detector
OutputMarkdown, HTML, JSON, DocTags, plain textPlain text; no layout, table or page-level output
LicenceMIT (individual models have their own licences)MIT (microsoft/unilm repository)
Model sizeGraniteDocling VLM option: 258MBase 334M, large 558M
BenchmarkNot publishedIAM handwriting CER 2.89 (TrOCR-large), reported by the authors
LanguagesNot publishedReleased checkpoints are English-focused; other languages need fine-tuning
Known failureVersion 2.143.1 drops words and numbers with full-page Tesseract OCR (issue #5254); reading order can merge neighbouring columns (issue #5132)Slow versus CRNN recognizers on CPU, with up to 558M parameters for one text line

Sources

What each one is

Docling

IBM's open-source document converter with a structured document model.

Docling details

TrOCR

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

TrOCR 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": "ibm/docling","fallbacks": ["microsoft/trocr"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

Docling alternativesTrOCR alternativesBest OCR models in 2026