TrOCR vs Nanonets-OCR
Pick TrOCR if you need to read single lines of English handwriting or fine-tune a recognizer on your own line images. Pick Nanonets-OCR if you need whole printed business documents turned into Markdown, with signatures, checkboxes and flowcharts tagged. The main split is scope: TrOCR reads one text line at a time and needs a separate line detector, while Nanonets-OCR reads full pages but is weak on handwriting.
TrOCRmicrosoft/trocr | Nanonets-OCRnanonets/nanonets-ocr | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 2 credits / page |
| Per 1,000 pages | $1.00 | $2.00 |
| Typical speed | 1.2 s / page | 1.8 s / page |
| Best for | Handwritten text lines | Markdown with semantic tags |
| Inputs | images | PDF, images |
| Languages | English | Multilingual |
| Max pages per request | 100 | 500 |
| Tables | No | ✓ Yes |
| Handwriting | ✓ Yes | No |
| Math | No | ✓ Yes |
| Bounding boxes | No | No |
| Confidence | No | No |
| Forms | No | ✓ Yes |
| Multilingual | No | ✓ Yes |
| 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 TrOCR if
- It reports a 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, and it is a good base for fine-tuning on custom line images.
- It uses the MIT licence and loads in a few lines with Hugging Face transformers.
Choose Nanonets-OCR if
- It converts printed PDFs and business documents to Markdown, and can output HTML, LaTeX and Mermaid as well.
- It tags signatures, watermarks and image descriptions, converts checkboxes to unicode symbols, and extracts flowcharts and org charts as Mermaid code.
- It scores 89.43 on DocVQA for the 3B model, per the model card.
Key differences
| TrOCR | Nanonets-OCR | |
|---|---|---|
| Input scope | Single text-line images only, so you need a separate line detector | Full document pages converted to Markdown |
| Output formats | Plain text | Markdown, HTML, LaTeX and Mermaid |
| Handwriting | 2.89 CER on IAM with the large model; English handwritten lines are a stated good fit | Not trained on handwriting and can hallucinate; one test saw generation loops with CER up to 2100% and 69.1s per image on an L4 |
| Licence | MIT (microsoft/unilm repository) | Not stated on the Nanonets-OCR2-3B model card; base model is Qwen2.5-VL-3B |
| Model size | Base 334M, large 558M parameters | 3B (Hugging Face lists about 4B) |
| Languages | Released checkpoints are English-focused; other languages need fine-tuning | Not published |
| Prompting and known failure | No layout, table or page-level output | Trained on a fixed prompt; the team says hallucination with other prompts is expected. olmOCR-bench overall is 69.5 |
Sources
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
- Nanonets-OCR2-3B model card
- Nanonets-OCR-s announcement
- HF discussion fixed prompt
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsNanonets-OCR
Open image-to-Markdown model that tags tables, equations, signatures, watermarks and checkboxes.
Nanonets-OCR detailsTry both on your own file
Run the file once with each model and compare the output.
Use one, fall back to the other
{"model": "microsoft/trocr","fallbacks": ["nanonets/nanonets-ocr"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
TrOCR alternativesNanonets-OCR alternativesBest OCR models in 2026