OCRRouter

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/trocrSmolDoclinghuggingface/smoldocling
TypeOpen sourceOpen source
Price1 credit / page1 credit / page
Per 1,000 pages$1.00$1.00
Typical speed1.2 s / page1.0 s / page
Best forHandwritten text linesVery cheap page conversion
InputsimagesPDF, images
LanguagesEnglishMainly English
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

  • 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

TrOCRSmolDocling
Input scopeSingle text-line images only; you need a separate line detectorFull pages, with text, tables, code, formulas and charts
OutputPlain textDocTags, Markdown, HTML, JSON, LaTeX, bounding boxes
SizeBase 334M, large 558M parameters256M parameters
LicenceMIT (microsoft/unilm repository)Apache-2.0 per model summary (metadata tag says CDLA-Permissive-2.0)
LanguagesEnglish-focused checkpoints; other languages need fine-tuningEnglish only
Reported accuracyIAM handwriting CER 2.89 (large)Table TEDS 0.82 on FinTabNet, full-page OCR F1 0.80
Known failureSlow on CPU versus CRNN recognizers; no layout or table outputOutput can loop with endless token repetition or missing closing tags; preview release, superseded by Granite-Docling

Sources

What each one is

TrOCR

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

TrOCR details

SmolDocling

Tiny 256M vision model from Hugging Face and IBM that outputs DocTags. Predecessor of Granite Docling.

SmolDocling 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": ["huggingface/smoldocling"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

TrOCR alternativesSmolDocling alternativesBest OCR models in 2026