PDFMathTranslate and BabelDOC both translate PDFs while keeping layouts and formulas, and both can use a local AI model instead of a cloud service. They're closely related: BabelDOC is the translation engine behind PDFMathTranslate 2.0.
The short version
PDFMathTranslate | BabelDOC | |
|---|---|---|
What it is | An application for translating scientific PDFs while preserving layouts | A PDF translation and bilingual comparison library |
Versions | 1.x (pdf2zh, stable) and 2.0 (pdf2zh-next, based on BabelDOC) | Single library, used by PDFMathTranslate 2.0 |
Interfaces | Command line, browser GUI, Windows ZIP or EXE, Docker | Command line and Python API |
Translation services | Many, including Ollama (1.x), OpenAI-compatible APIs, Google and DeepL | OpenAI-compatible LLMs only |
Licence | AGPL v3 | AGPL v3 |
Aimed at | End users | Developers embedding it in other programs |
How they're related
PDFMathTranslate began as an application, and version 2.0 moved to a new repository, PDFMathTranslate-next. That version describes itself as based on BabelDOC and as the official reference implementation for calling BabelDOC to translate PDFs. The 1.x README also lists BabelDOC as a new backend, and pdf2zh 1.x has an experimental --babeldoc option. In practice, PDFMathTranslate is the app and BabelDOC is the engine.
Ease of use
PDFMathTranslate is the friendlier choice. Version 2.0 has a recommended Windows EXE that opens a WebUI in your browser, while 1.x offers pdf2zh -i for a browser GUI and a Windows ZIP, and both offer Docker. BabelDOC is installed with uv and run from the command line or Python, and its own README says that the CLI is mainly for debugging, that it doesn't provide technical support for end users, and that end users who want to self-host should use PDFMathTranslate 2.0.
Local AI support
Both can keep translation on your PC. PDFMathTranslate 1.x has a dedicated ollama service configured with OLLAMA_HOST and OLLAMA_MODEL, and also supports Xinference and OpenAI-compatible endpoints. Version 2.0 lists an OpenAICompatible engine as officially supported, and its WebUI has an Ollama host field. BabelDOC only supports OpenAI-compatible LLMs, but its README notes that for local models like Ollama you can use any value as the API key. Ollama provides an OpenAI-compatible API at http://localhost:11434/v1/, as covered in our Ollama OpenAI API guide.




