GLM-OCR vs Florence-2
Pick GLM-OCR for full-page PDF to Markdown, formulas in academic papers, and field extraction into a JSON schema. Pick Florence-2 only when you need small-model text with bounding boxes on scene text or short English labels, or when the same model must also caption and detect. The main reason is output: GLM-OCR returns Markdown and JSON, while Florence-2 returns only plain text and boxes.
GLM-OCRzai/glm-ocr | Florence-2microsoft/florence-2 | |
|---|---|---|
| Type | Open source | Open source |
| Price | 6 credits / page | 1 credit / page |
| Per 1,000 pages | $6.00 | $1.00 |
| Typical speed | 1.3 s / page | 0.8 s / page |
| Best for | Low-cost general documents | Lightweight OCR with boxes |
| Inputs | PDF, images | images |
| Languages | 100+ languages | English |
| Max pages per request | 500 | 500 |
| Tables | ✓ Yes | No |
| Handwriting | No | No |
| Math | ✓ Yes | No |
| Bounding boxes | ✓ Yes | ✓ Yes |
| Confidence | ✓ Yes | 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 GLM-OCR if
- It returns Markdown, JSON and plain text, so full pages convert to structured output.
- It scores 94.62 on OmniDocBench v1.5 per its own model card, and it can extract fields into a user-defined JSON schema.
- You can call the Z.ai API at $0.03 per million tokens for input and output, or self-host it with vLLM, SGLang, Ollama or transformers.
Choose Florence-2 if
- It is very small at 0.23B (base) and 0.77B (large), which suits lightweight edge OCR in English.
- OCR_WITH_REGION returns quadrilateral boxes per text line.
- The same model also does captioning, detection and grounding, so one model covers a mixed pipeline.
Key differences
| GLM-OCR | Florence-2 | |
|---|---|---|
| Size | 0.9B parameters | 0.23B (base), 0.77B (large) |
| How you run it | Z.ai API, or self-host with vLLM, SGLang, Ollama or transformers | Self-host via Transformers only |
| Licence | MIT for the model weights; SDK repo and bundled PP-DocLayoutV3 are Apache-2.0 | MIT |
| Price | API: $0.03 per million tokens for input and output. Self-hosted: free, you pay for compute | Free, self-hosted, you pay for compute |
| Output formats | Markdown, JSON, plain text | Plain text and bounding boxes. No Markdown, tables or LaTeX |
| Benchmark | OmniDocBench v1.5 overall 94.62 (authors); ParseBench mean 29.6 (independent) | TextCaps CIDEr zero-shot 72.8 and COCO detection mAP zero-shot 37.5 (large, authors). No document OCR benchmark published |
| Known failures | Repeats output unless a stop sequence is set; drops table footer and summary rows; loses comma decimal separators in cropped tables; no aarch64 Linux support | Spelling errors and missing spaces on cursive handwriting and French text; Chinese output mostly wrong because the vocabulary lacks CJK characters |
Sources
- Hugging Face model card (GLM-OCR)
- Z.ai GLM-OCR docs and pricing
- Issue #240 missing table rows
- Florence-2-large model card
- HF blog OCR test
- HF discussion Chinese very bad
What each one is
Florence-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.
PDF, PNG, JPG, WebP, HEIC. Up to 20 MB each, 10 files.No file?
Use one, fall back to the other
{"model": "zai/glm-ocr","fallbacks": ["microsoft/florence-2"],"file_url": "https://example.com/document.pdf"}Questions
More comparisons
GLM-OCR vs Tesseract.jsGLM-OCR vs Typhoon OCRUnlimited OCR vs Florence-2PaddleOCR-VL vs Florence-2Qianfan OCR vs GLM-OCRGemini Flash vs GLM-OCRGLM-OCR vs dots.ocrGPT vs Florence-2
GLM-OCR alternativesFlorence-2 alternativesBest OCR models in 2026