TrOCR vs Donut
Pick TrOCR when you already have cropped single text lines and want an English recognizer, especially for handwriting. Pick Donut when you need structured JSON from whole documents such as receipts or forms and can fine-tune on your own layout. The main split is scope: TrOCR reads one line of text, Donut maps a document image to fields.
TrOCRmicrosoft/trocr | Donutnaver/donut | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 1 credit / page |
| Per 1,000 pages | $1.00 | $1.00 |
| Typical speed | 1.2 s / page | 1.0 s / page |
| Best for | Handwritten text lines | Receipt and form fields after fine-tuning |
| Inputs | images | images |
| Languages | English | English, Chinese, Japanese, Korean |
| Max pages per request | 100 | 100 |
| Tables | No | No |
| Handwriting | ✓ Yes | No |
| Math | No | No |
| Bounding boxes | No | No |
| Confidence | No | No |
| Forms | No | ✓ Yes |
| Multilingual | No | 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 TrOCR if
- It has separate checkpoints fine-tuned for handwritten (IAM), printed (SROIE) and scene text, so you can match the checkpoint to your input.
- The paper reports 2.89 character error rate on the IAM handwriting set with the large model.
- It loads in a few lines with Hugging Face transformers, which makes it a simple recognizer to drop into a pipeline you already have.
Choose Donut if
- It needs no external OCR step: it maps document images straight to JSON, so you do not need a line detector.
- It suits receipt and form field extraction, document classification and narrow, fixed-layout document types after fine-tuning.
- A practitioner on Hacker News reports that about 200 fine-tuning documents can reach human-level accuracy on narrow data.
Key differences
| TrOCR | Donut | |
|---|---|---|
| Input scope | Single text-line images only. You need a separate line detector. | Whole document images, no external OCR step. |
| Output | Plain text | JSON or plain text |
| Out-of-the-box use | Checkpoints are fine-tuned for handwritten, printed (SROIE) and scene text. | The base checkpoint is pretrain-only and must be fine-tuned before use. |
| Benchmark | 2.89 CER on IAM handwriting (TrOCR-large), per the paper. | Not published |
| Model size | Base 334M, large 558M parameters. | Not published |
| Languages | Released checkpoints are English-focused. Other languages need fine-tuning. | Not published |
| Known failure | No layout, table or page-level output. Slow versus CRNN recognizers on CPU. | Misses tiny text in large images due to input resolution limits. Transformers v5 dropped image-to-text pipeline support, so load it directly or use v4. |
| Licence and cost | MIT, free and self-hosted (you pay for compute). | MIT, free and self-hosted (you pay for compute). |
Sources
- TrOCR paper (arXiv 2109.10282)
- trocr-large-handwritten model card
- donut-base model card
- Donut ECCV paper
- Hacker News thread
What each one is
TrOCR
Transformer text recognition model. Reads single text lines, including handwriting.
TrOCR detailsDonut
OCR-free document understanding model. Fine-tuned for receipts, forms and document Q&A.
Donut 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": "microsoft/trocr","fallbacks": ["naver/donut"],"file_url": "https://example.com/document.pdf"}