WindowsmacOSLinux

Where Does Tesseract Store Language Data?

Where Tesseract keeps its tessdata language files on each OS, and the variable that overrides the search path.

Last updated

Tesseract reads its language models from a folder called tessdata, and that folder moves between install methods. Linux distro packages use a share path that differs by distribution and release. Homebrew buries it in the cellar, and the Windows installer puts it beside the binaries.

The stable answer across all of them is the TESSDATA_PREFIX variable, which overrides the compiled-in search path. Set it once and version upgrades stop breaking your scripts. Each language is a single .traineddata file, so adding support means dropping one file into the right folder.

Where Tesseract stores this, by platform

Windows
C:\Program Files\Tesseract-OCR\tessdata

Used by the UB Mannheim installers for Tesseract 4 and 5. Drop extra .traineddata files here with 7-Zip or similar. Add the binaries folder to PATH so tesseract runs from any directory. Per-user installs may use a LocalAppData path instead.

macOS
/opt/homebrew/share/tessdata

Homebrew and MacPorts each choose their own prefix, and upgrades move the cellar path. Run brew info tesseract to print the exact folder on your machine. TESSDATA_PREFIX overrides everything when you keep models beside a project.

Linux
/usr/share/tesseract-ocr/tessdata

Exact name depends on distro and release: tesseract-ocr, plain tessdata, or a versioned folder. Check both candidates before assuming the install is broken. System packages usually ship the fast model set only, so best and legacy models need manual download.

Frequently asked questions

how do I add a language to Tesseract

Download the .traineddata file for your language and copy it into the tessdata directory for your install. The fast, best, and standard variants each have their own repository, and most distro packages ship the fast set. Restart anything holding the old path after adding files.

how do I point Tesseract at custom traineddata

Set TESSDATA_PREFIX to the folder holding your tessdata directory and Tesseract looks there first. This beats reinstalling or duplicating files when you keep custom traineddata beside a project. Point it at the parent, not at tessdata itself.

how do I find the exact path on my machine

Run the tesseract binary with no usable path and it reports where it searched, which settles version disputes fast. Homebrew moves the cellar path on upgrades, and distro packages rename the folder between releases, so trust the binary over old guides.

Notice an outdated path? Let us know.