Docling OCRIndependent Docling guide

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) or OcrOptions.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 with iso: (iso:de, iso:zh-Hant).
  • –mul, und and zxx are rejected behind iso: — 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.

Both forms, side by side
# 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 fr

The 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

EngineMultiple languagesEmpty language list means
RapidOCRFirst only, rest ignored with a warningSimplified Chinese default
Nemotron-OCRFirst only, rest ignored with a warningEnglish model
EasyOCRAccepted; one checkpoint is selectedEnglish
TesseractAccepted; validated against installed tessdataPer-page orientation and script detection (needs osd)
ocrmacInherited from VisionVision automatic behaviour
KServe v2Only first entry senten
Empty language list = omitting --ocr-lang, or passing --ocr-lang ""

Chinese, Japanese, Korean

  • Simplified Chinese: RapidOCR is the path of least resistance — its default recognition models are Chinese, so --ocr-engine rapidocr with no language often just works. With Tesseract, install chi_sim first.
  • Traditional Chinese: pass iso:zh-Hant or the engine's traditional code (chi_tra for Tesseract). Simplified vs traditional is a different model, not a different setting.
  • Japanese: Tesseract needs jpn and, for vertical text, better luck with a stronger engine; EasyOCR supports ja. Vertical writing is a known weak spot across engines — plan to review.
  • Korean: kor for Tesseract, ko for 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.

Per-language pass over page ranges
# 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-14

Page-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 sure TESSDATA_PREFIX points at the tessdata directory, 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 browser

Keep reading