← Home

REVIEWED & READY TO INSTALL

PDFMathTranslate

pdfmathtranslate/pdfmathtranslate

A free tool that translates whole PDF files into another language while keeping the layout: math formulas, charts, tables and the table of contents stay in place. It outputs a translated-only copy and a bilingual copy. The default service is Google, no API key needed. Works on the web (pdf2zh.com), as a Windows build, with Python or Docker. Note: Vietnamese is not on the official GUI language list, so test a short file first.

STEP BY STEP

How to install PDFMathTranslate

The step-by-step guide is right on this page, written for people who have never installed anything from GitHub.

Updated 10/6/2026
GitHub preview image of PDFMathTranslate
GitHub stars
37,351
Language
Python
Added
10/6/2026

How to install PDFMathTranslate, step by step

Work from top to bottom. Each grey box is one command: copy the whole line, paste it into the terminal window and press Enter.

Never used a terminal? Read this first (1 minute)

A terminal is a window where you type commands for your computer. You do not need to understand them, just copy and paste them exactly.

  1. Windows: press the Windows key, type "PowerShell", then press Enter.
  2. macOS: press Command + Space, type "Terminal", then press Enter.
  3. Linux: press Ctrl + Alt + T.
  4. Copy a command from the guide, right-click inside the window you just opened to paste it (macOS: Command + V), then press Enter.
  5. Wait for the command to finish (the cursor blinks again on a new line) before running the next one.

Lines starting with # are notes; you do not need to copy them. If red error text appears, check the common errors section at the end of the guide.

1. What is PDFMathTranslate?

PDFMathTranslate (also called pdf2zh) is a free tool that translates a whole PDF into another language while keeping the layout: math formulas, charts, tables, the table of contents and annotations stay where they were. It was built for scientific papers and was presented at the EMNLP 2025 conference. You feed in one PDF and get back two: one with only the translated text and one bilingual copy.

It replaces copying paragraphs into a translator and pasting them back (which wrecks the formatting), or paid document-translation services. The default translation service is Google, so no API key is needed. The project uses the AGPL-3.0 license.

A good fit if:

  • You read English papers, technical docs or textbooks as PDFs and want a translation that looks like the original.
  • You want a bilingual copy to compare paragraph by paragraph.
  • You do not want to pay for or sign up to a document-translation service.

Not a fit if:

  • You need verified, polished Vietnamese output. The README and the project's GUI docs do not list Vietnamese among the officially supported languages of the web interface (ten are listed: English, Simplified and Traditional Chinese, French, German, Japanese, Korean, Russian, Spanish, Italian). The command line accepts Google language codes, so vi is a valid code, but test a short file first.
  • Your PDF is a fully scanned image. The OCR support (reading text from images) is marked experimental.
  • You are translating confidential documents. The default service sends the text to Google, so think before you use it.

2. What you need

There are three routes, from easiest to hardest:

  1. Use it on the web, install nothing. You need a browser and internet. The README points to https://pdf2zh.com/ as a "Public free service". Resources are limited, so do not abuse it.
  2. Windows build (.zip). You need 64-bit Windows. If it will not open, also install the "Microsoft Visual C++ Redistributable" (a bundle of components many Windows programs need): vc_redist.x64.exe from https://aka.ms/vs/17/release/vc_redist.x64.exe, as the README suggests.
  3. Install with Python or Docker. You need Python (a programming language, from https://www.python.org/downloads/) version 3.11 to 3.12, or Docker (software that runs apps in ready-made "boxes") from https://www.docker.com/.

No account and no API key are needed with the default Google service. On the first run the program downloads an AI model that detects page layout, so you need internet and some free disk space (the docs give no exact size).

3. Step-by-step setup

Way A: Use it on the web

  1. Go to https://pdf2zh.com/.
  2. Drop your PDF in, choose the target language and translate. File-size and usage limits are set by the site, so check them there.

Getting a translated PDF to download means it worked.

Way B: Windows .zip (no Python needed)

Step 1: Download

Go to https://github.com/PDFMathTranslate/PDFMathTranslate/releases and download pdf2zh-v1.9.11-win64.zip (v1.9.11 is the latest release on the Releases page, published July 2025). There is also a with-assets file that bundles the model, useful if you cannot download it at run time.

Step 2: Unzip and run

Unzip it, then double-click pdf2zh.exe. If Windows cannot open it, install vc_redist.x64.exe as described in section 2 and try again.

A window or a browser page opening means it is working.

Way C: Install with Python

Step 1: Install Python

Install Python 3.11 or 3.12 from https://www.python.org/downloads/. On Windows, tick "Add python.exe to PATH" on the installer's first screen.

Step 2: Install pdf2zh

Open Terminal (macOS/Linux) or PowerShell (Windows) and run:

pip install pdf2zh

Finishing with no red errors means success. (The README also shows a uv route: pip install uv, then uv tool install --python 3.12 pdf2zh.)

Step 3: Open the browser interface

pdf2zh -i

If the browser does not open by itself, go to http://localhost:7860/. Drop a PDF in the window and click Translate.

Way D: Docker

docker pull byaidu/pdf2zh
docker run -d -p 7860:7860 byaidu/pdf2zh

Then open http://localhost:7860/.

4. First use

The quickest test is the command line, in the folder that holds your PDF:

pdf2zh document.pdf

Per the README, it creates two files in the current folder: document-mono.pdf (translation only) and document-dual.pdf (bilingual).

Important: The default target language is Simplified Chinese (the README uses -lo zh in its example, and the GUI docs list the default as "Simplified Chinese"). To pick another language, add -li (source) and -lo (target), for example:

pdf2zh document.pdf -li en -lo vi

Language codes follow Google and DeepL. Vietnamese is not on the official GUI list, so try a short file, check the bilingual copy, and only then translate long documents. To translate only some pages, add -p 1 (page 1 only).

5. Common problems and fixes

SymptomLikely causeFix
pdf2zh or pip says "command not found" / "not recognized"Python is not installed or not on PATHReinstall Python, tick "Add python.exe to PATH", open a new terminal
Install complains about the Python versionThe README requires Python 3.11 to 3.12Install Python 3.12 and rerun
Stuck downloading the modelIn some regions the model host (Hugging Face) is unreachableSet HF_ENDPOINT=https://hf-mirror.com as the README describes (PowerShell: $env:HF_ENDPOINT = "https://hf-mirror.com"), or use the with-assets zip
The translation comes out in ChineseThe target language was not setAdd -lo vi (or another language code)
pdf2zh.exe will not open on WindowsMissing Visual C++ componentsInstall vc_redist.x64.exe and retry
Port 7860 is already in useAnother program is using itAdd --serverport 7861 and open the new port

If it still fails, see the FAQ in the project wiki: https://github.com/PDFMathTranslate/PDFMathTranslate/wiki

6. Uninstall / update

  • Python: uninstall with pip uninstall pdf2zh; update with pip install -U pdf2zh. If you installed with uv, use uv tool uninstall pdf2zh.
  • Windows zip: delete the unzipped folder; to update, download the newer zip.
  • Docker: stop and remove the container in Docker Desktop; to update, run docker pull byaidu/pdf2zh.

7. FAQ

Does it cost money? The program is free. The default translation service (Google) needs no key. If you choose another service such as OpenAI or DeepL, you need your own API key and the provider may charge you.

Does my data go anywhere? With the default service, the text in your PDF is sent to the translation service. The project also supports local services such as Ollama (see the advanced docs) if you want to keep things on your machine.

Do I need internet? Yes: to download the model the first time and to call the translation service.

Is it only for scientific papers? The project targets scientific papers, though the README describes it as a layout-preserving PDF translator. Try it on your own file first.

Any other PDF tools on githot? Yes: BentoPDF (PDF tools in your browser) at https://www.githot.io.vn/en/repo/bentopdf, and RetainPDF at https://www.githot.io.vn/en/repo/wxyhgk-retain-pdf.

Written by GitHot and checked against the project's official documentation. If a step is wrong or unclear, message GitHot through the channels at the bottom of the page.

SEE WHY IT'S HOT

Watch the original review

Go back to the video that brought you here.

Watch on TikTok ↗

Don't miss the next repo

Every new repo gets a video review, with its install guide right here.

Follow on TikTok ↗