OCRRouter

docTR vs TrOCR

Pick docTR when you need word-level OCR with coordinates on full pages such as invoices and receipts, because it detects text and returns a page, block, line and word structure. Pick TrOCR when you already have cropped single text-line images, especially English handwriting, because it reports 2.89 CER on IAM with the large model. TrOCR cannot read a full page by itself, so you must add a line detector.

docTRmindee/doctrTrOCRmicrosoft/trocr
TypeOpen sourceOpen source
Price1 credit / page1 credit / page
Per 1,000 pages$1.00$1.00
Typical speed0.9 s / page1.2 s / page
Best forWord-level OCR with positionsHandwritten text lines
InputsPDF, imagesimages
LanguagesMainly Latin scriptsEnglish
Max pages per request500100
TablesNoNo
HandwritingNo✓ Yes
MathNoNo
Bounding boxes✓ YesNo
Confidence✓ YesNo
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 docTR if

  • You need to read whole pages: docTR runs detection and recognition in two stages and returns a nested page, block, line and word structure with coordinates as JSON.
  • You want to choose or train your own models, with a choice of detection and recognition architectures and straight or rotated boxes.
  • You want ready Docker images and a demo on Hugging Face Spaces under Apache-2.0, plus a key information extraction predictor for invoices and receipts.

Choose TrOCR if

  • You are reading English handwritten lines: the large model reports 2.89 character error rate on the IAM handwriting set, per the paper.
  • You want a recognizer to fine-tune on your own line images, with separate checkpoints for handwritten (IAM), printed (SROIE) and scene text.
  • You want to load a model in a few lines with Hugging Face transformers under the MIT licence.

Key differences

docTRTrOCR
What it readsFull pages: detection plus recognition, output down to word levelSingle text-line images only, per the model card; you need a separate line detector
OutputJSON with page, block, line and word structure and coordinates; plain text; bounding boxesPlain text; no layout, table or page-level output
LicenceApache-2.0MIT (microsoft/unilm repository)
How you run itLocal Python library on PyTorch, with Docker images; GPU images need CUDA 12.2 or newer on the hostLocal, through Hugging Face transformers
BenchmarkNot publishedIAM handwriting CER 2.89 (TrOCR-large), reported by the authors
LanguagesNot publishedReleased checkpoints are English-focused; other languages need fine-tuning
Known failureSplit-crop merging misjoins readings across repeated characters (issue #2229); cropping images gives poorer results (issue #2007); ONNX export of MASTER truncates decoding steps (issue #2224)Up to 558M parameters for one text line (base 334M, large 558M), slow versus CRNN recognizers on CPU

Sources

What each one is

docTR

Open-source OCR library from Mindee with separate text detection and recognition models.

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

Questions

More comparisons

docTR alternativesTrOCR alternativesBest OCR models in 2026