GPT vs TrOCR
Pick GPT for handwritten notes, whole pages and PDFs, and for pulling fields into custom JSON through a hosted API. Pick TrOCR for English text-line recognition that you run yourself under an MIT licence, or as a base to fine-tune on your own line images. TrOCR reads only single text-line images, so a page needs a separate line detector in front of it.
GPTopenai/gpt | TrOCRmicrosoft/trocr | |
|---|---|---|
| Type | Vision model | Open source |
| Price | 11 credits / page | 1 credit / page |
| Per 1,000 pages | $11.00 | $1.00 |
| Typical speed | 2.4 s / page | 1.2 s / page |
| Best for | Messy scans, custom instructions | Handwritten text lines |
| Inputs | PDF, images | images |
| Languages | 50+ languages | English |
| Max pages per request | 100 | 100 |
| Tables | ✓ Yes | No |
| Handwriting | ✓ Yes | ✓ Yes |
| Math | ✓ Yes | No |
| Bounding boxes | No | No |
| Confidence | No | No |
| Forms | No | No |
| Multilingual | ✓ Yes | No |
| On OCRRouter | Available | Available |
Prices are what you pay on OCRRouter. Speed is the provider's typical figure, not a benchmark we ran.
Which to choose
Choose GPT if
- It takes PDFs and page images directly, with files up to 50 MB per request, so you need no line detector.
- It can be prompted to return Markdown, JSON or plain text, which suits extraction into custom JSON and document question answering.
- An HN user reported about 5% errors on messy cursive versus about 30% for Mistral OCR.
Choose TrOCR if
- It is MIT licensed and free to self-host, so you pay only for compute and no per-token fees.
- The large model reports 2.89 character error rate on the IAM handwriting set, and there are separate checkpoints for handwritten (IAM), printed (SROIE) and scene text.
- It loads in a few lines with Hugging Face transformers and can be fine-tuned on custom line images.
Key differences
| GPT | TrOCR | |
|---|---|---|
| Input | Images and PDFs, up to 50 MB per request | Single text-line images only; a separate line detector is needed |
| How you run it | Hosted API from OpenAI | Local library via Hugging Face transformers |
| Licence | Proprietary | MIT (microsoft/unilm repository) |
| Price | Token-based per model; page images add input tokens, so cost per page is not fixed | Free, self-hosted; you pay for compute |
| Output | Markdown, JSON, plain text; no bounding boxes or confidence scores in the standard response | Plain text only; no layout, table or page-level output |
| Benchmark | GPT-5.2 scores 85.50 on OmniDocBench v1.5 and 86.59 on v1.6 (independent) | 2.89 CER on IAM handwriting with TrOCR-large (reported by the authors) |
| Languages | Not published | Released checkpoints are English-focused; other languages need fine-tuning |
Sources
- OpenAI file inputs docs
- OmniDocBench leaderboard
- HN Mistral OCR thread
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsTry 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": "openai/gpt","fallbacks": ["microsoft/trocr"],"file_url": "https://example.com/document.pdf"}