OCRRouter

Google Document AI vs TrOCR

Pick Google Document AI to OCR whole pages and PDFs on Google Cloud, with bounding boxes, chunking for RAG and batch jobs up to 500 pages. Pick TrOCR to read single English text lines, such as handwriting or receipt lines, or to fine-tune a recognizer on your own line images. The main split is scope: Document AI is a paid page-level service, TrOCR is a free line-level model that needs a separate line detector.

Google Document AIgoogle/document-aiTrOCRmicrosoft/trocr
TypeOCR APIOpen source
Price10 credits / page1 credit / page
Per 1,000 pages$10.00$1.00
Typical speed1.4 s / page1.2 s / page
Best forMultilingual scansHandwritten text lines
InputsPDF, imagesimages
Languages200+ languagesEnglish
Max pages per request500100
Tables✓ YesNo
Handwriting✓ Yes✓ Yes
MathNoNo
Bounding boxes✓ YesNo
Confidence✓ YesNo
Forms✓ YesNo
Multilingual✓ YesNo
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 Google Document AI if

  • You need to process full pages or PDFs, and get JSON, plain text, bounding boxes or chunks back.
  • You want RAG chunking from Layout Parser at $10 per 1,000 pages, or Enterprise OCR at $1.50 per 1,000 pages.
  • You need bulk jobs: batch requests take up to 500 pages and the first 1,000 pages are free.

Choose TrOCR if

  • You read English handwritten lines, where the large model reports 2.89 character error rate on the IAM set.
  • 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 free, MIT-licensed model that runs locally and loads in a few lines with Hugging Face transformers.

Key differences

Google Document AITrOCR
DeploymentHosted API on Google CloudLibrary you run locally through Hugging Face transformers
LicenceProprietaryMIT (microsoft/unilm repository)
PriceEnterprise OCR $1.50 per 1,000 pages ($0.60 above 5M/month, first 1,000 free); Layout Parser $10; Form Parser $30 per 1,000 pagesFree, self-hosted; you pay for compute
Input unitPages and PDFs. Online requests up to 15 pages (30 in imageless mode), batch up to 500 pagesSingle text-line images only; you need a separate line detector
OutputJSON, plain text, bounding boxes, chunksPlain text only, no layout, table or page-level output
Benchmark64.6% on RD-TableBench table accuracy (independent), behind Azure and Textract2.89 CER on IAM handwriting with TrOCR-large (reported by the authors)
Known limitsWeak on complex tables; Form Parser batch limited to 100 pagesEnglish-focused checkpoints; other languages need fine-tuning. Up to 558M parameters for one line, slow on CPU versus CRNN recognizers

Sources

What each one is

Google Document AI

Google Cloud OCR with layout parsing and specialised processors.

Google Document AI 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": "google/document-ai","fallbacks": ["microsoft/trocr"],"file_url": "https://example.com/document.pdf"}

Questions

More comparisons

Google Document AI alternativesTrOCR alternativesBest OCR models in 2026