docTR vs Florence-2
Pick docTR for printed documents such as invoices and receipts, where you need word-level text with coordinates and a nested page, block, line and word JSON export. Pick Florence-2 for scene text and short English labels, or when one small model must also do captioning and detection. Neither model outputs tables or Markdown, and Florence-2 is a poor fit for handwriting and Chinese.
docTRmindee/doctr | Florence-2microsoft/florence-2 | |
|---|---|---|
| Type | Open source | Open source |
| Price | 1 credit / page | 1 credit / page |
| Per 1,000 pages | $1.00 | $1.00 |
| Typical speed | 0.9 s / page | 0.8 s / page |
| Best for | Word-level OCR with positions | Lightweight OCR with boxes |
| Inputs | PDF, images | images |
| Languages | Mainly Latin scripts | English |
| Max pages per request | 500 | 500 |
| Tables | No | No |
| Handwriting | No | No |
| Math | No | No |
| Bounding boxes | ✓ Yes | ✓ Yes |
| Confidence | ✓ Yes | No |
| Forms | No | No |
| 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 docTR if
- It exports a nested page, block, line and word structure with coordinates as JSON, which suits custom extraction on invoices and receipts.
- You can choose detection and recognition architectures, with straight or rotated boxes, and train your own models in Python.
- It is Apache-2.0, ships ready Docker images, and includes a key information extraction predictor.
Choose Florence-2 if
- It is small at 0.23B (base) or 0.77B (large) parameters and MIT licensed, so it suits lightweight edge OCR in English.
- OCR_WITH_REGION returns quadrilateral boxes per text line, which works for scene text and short labels.
- The same model also does captioning, detection and grounding, so one model can serve a pipeline that needs more than OCR.
Key differences
| docTR | Florence-2 | |
|---|---|---|
| What it is | Two-stage text detection and recognition OCR library from Mindee, built on PyTorch | Microsoft's prompt-based vision foundation model with OCR as one of its tasks |
| Licence | Apache-2.0 | MIT |
| How you run it | Locally in Python, with Docker images; GPU images need CUDA 12.2 or newer on the host | Self-hosted via Transformers |
| Price | Free, self-hosted (you pay for compute) | Free, self-hosted (you pay for compute) |
| Output formats | JSON with page, block, line and word hierarchy, plain text, bounding boxes | Plain text and bounding boxes (quadrilateral boxes per text line) |
| Model size | Not published | 0.23B (base), 0.77B (large) |
| Known failures | Split-crop merging misjoins readings across repeated characters; cropping images gives poorer results; ONNX export of MASTER truncates decoding steps | Spelling errors and missing spaces on cursive handwriting and French text; Chinese output mostly wrong because the vocabulary lacks CJK characters |
Sources
- docTR GitHub README
- docTR documentation
- Issue #2229
- Florence-2-large model card
- HF blog OCR test
- HF discussion Chinese very bad
What each one is
docTR
Open-source OCR library from Mindee with separate text detection and recognition models.
docTR detailsFlorence-2
Small Microsoft vision model (0.23B and 0.77B) with OCR and OCR-with-regions tasks that return text with boxes.
Florence-2 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": "mindee/doctr","fallbacks": ["microsoft/florence-2"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
docTR alternativesFlorence-2 alternativesBest OCR models in 2026