Configuration · languages
Docling OCR Languages: Getting the Right Recognizer for the Right Script
A correct language setting is the difference between a clean transcription and a page of plausible-looking nonsense. Docling passes languages to whichever engine you chose — and each engine treats that list differently.
Updated 2026-10-26 · 3 min read
The short version
- –Languages are set with
--ocr-lang(CLI) orOcrOptions.lang(Python), and the field is per-engine. - –Two forms are accepted: the engine's native codes (
deu,ch,script/Cyrillic) and BCP-47 tags prefixed withiso:(iso:de,iso:zh-Hant). - –
mul,undandzxxare rejected behindiso:— there is no "any language" shortcut. - –RapidOCR and Nemotron-OCR use only the first language and warn about the rest. EasyOCR and Tesseract accept several.
- –An unsupported language raises an error. Docling never silently substitutes a different recognizer — which is good, but means a missing model fails the run.
Two ways to name a language
Docling accepts the native identifier each engine understands, and it also accepts BCP-47 language tags if you prefix them with iso:. The prefix is not cosmetic: it tells Docling to translate the tag before handing it to the engine.
Use native codes when you know the engine. Use iso: tags when the same configuration has to work across engines — for example a pipeline that runs ocrmac on a laptop and Tesseract in CI.
# native engine codes
docling convert vertrag.pdf --to md --ocr-engine tesseract --ocr-lang deu
docling convert scan.pdf --to md --ocr-engine tesseract --ocr-lang chi_sim
# BCP-47 tags
docling convert vertrag.pdf --to md --ocr-engine tesseract --ocr-lang "iso:de"
docling convert scan.pdf --to md --ocr-engine easyocr --ocr-lang "iso:zh-Hant"
# several languages at once (engine permitting)
docling convert mixed.pdf --to md --ocr-engine easyocr --ocr-lang en --ocr-lang frThe KServe v2 client ignores the iso: prefix entirely and sends only the first entry, exactly as written. If you rely on a remote OCR service, check what it actually receives before debugging accuracy.
Per-engine behaviour
| Engine | Multiple languages | Empty language list means |
|---|---|---|
| RapidOCR | First only, rest ignored with a warning | Simplified Chinese default |
| Nemotron-OCR | First only, rest ignored with a warning | English model |
| EasyOCR | Accepted; one checkpoint is selected | English |
| Tesseract | Accepted; validated against installed tessdata | Per-page orientation and script detection (needs osd) |
| ocrmac | Inherited from Vision | Vision automatic behaviour |
| KServe v2 | Only first entry sent | en |
Chinese, Japanese, Korean
- Simplified Chinese: RapidOCR is the path of least resistance — its default recognition models are Chinese, so
--ocr-engine rapidocrwith no language often just works. With Tesseract, installchi_simfirst. - Traditional Chinese: pass
iso:zh-Hantor the engine's traditional code (chi_trafor Tesseract). Simplified vs traditional is a different model, not a different setting. - Japanese: Tesseract needs
jpnand, for vertical text, better luck with a stronger engine; EasyOCR supportsja. Vertical writing is a known weak spot across engines — plan to review. - Korean:
korfor Tesseract,kofor EasyOCR. - Mixed CJK + Latin: EasyOCR handles multiple languages in one pass; Tesseract can too, but the per-language accuracy varies enough that per-page settings are often worth the complexity.
Mixed-language documents: the practical approach
A German contract with an English annex, or a Japanese invoice with English part numbers, is not solved by listing five languages. Listing them either gets ignored (RapidOCR, Nemotron) or produces a lowest-common-denominator recognizer (EasyOCR picks one checkpoint).
What works instead: convert pages in groups with the language set that matches them, or accept a review pass on the minority-language pages. Docling's per-page provenance makes this practical — you can see which pages produced suspiciously little text and re-run exactly those.
# run the German pages, then the English ones, and merge afterwards
docling convert contract.pdf --to md --ocr-engine tesseract --ocr-lang deu --page-range 1-8
docling convert contract.pdf --to md --ocr-engine tesseract --ocr-lang eng --page-range 9-14Page-range flags are version-specific. If --page-range is not present in your build, split the PDF first — the result is the same.
When a language is missing
Docling fails loudly rather than guessing. If the recognizer cannot serve the requested language, the run raises an error instead of quietly OCRing with a different model. That is the right behaviour for anything you are going to rely on, and it is also why "it worked on my machine" happens: language data is an install artefact.
For Tesseract the check happens when the options are constructed, against your installed tessdata. So the failure appears at startup, not per page — which makes it easy to catch in a smoke test.
- Tesseract: install
tesseract-ocr-deu(or the equivalent language pack) and make sureTESSDATA_PREFIXpoints at thetessdatadirectory, with a trailing slash. - EasyOCR: the first use of a language downloads its model; on an offline machine, pre-fetch it.
- RapidOCR: only the shipped model set is available — an unsupported language is a hard stop, not a fallback.
- ocrmac: coverage follows macOS Vision; older macOS versions support fewer scripts.
A configuration that survives production
- Record the engine and language list used for every conversion. Six months later, "which model read this invoice" is a real question.
- Smoke-test one page per language in CI, so a missing tessdata file fails the build rather than a customer request.
- Do not mix engine changes and language changes in the same release — if accuracy drops you will not know which caused it.
- Sample the output for the least-supported language in your set; that is where the error rate lives.
Frequently asked questions
What language codes does Docling accept?+
Either the engine's native codes (deu, chi_sim, script/Cyrillic) or BCP-47 tags prefixed with iso: (iso:de, iso:zh-Hant). The iso: prefix triggers translation for the chosen engine.
How do I OCR a Chinese PDF with Docling?+
RapidOCR is the simplest option — its default models are Simplified Chinese. For Traditional Chinese use iso:zh-Hant or chi_tra with Tesseract, which needs the language pack installed.
Why is only my first language being used?+
RapidOCR and Nemotron-OCR accept only the first language entry and warn about the rest. Switch to EasyOCR or Tesseract for genuinely multilingual pages.
What happens if I pass no language at all?+
Each engine falls back to its own default: Tesseract runs orientation/script detection, EasyOCR defaults to English, RapidOCR to Simplified Chinese, Nemotron to English, and ocrmac defers to Vision.
Can I use iso:mul or iso:und for unknown languages?+
No. mul, und and zxx are explicitly rejected behind the iso: prefix. Docling will not guess a recognizer for you.
Try it online
Run the same pipeline in the browser — no install, no uploads stored.
Try it in the browserKeep reading
- OCR engines compared
Which engine fits which script
- Docling OCR
When OCR runs at all
- Troubleshooting
Missing tessdata, engine errors
- Install Docling
Language packs and extras
- Papers to Markdown
Formula-heavy documents
- CLI reference
--ocr-lang and --ocr-option