High-precision document translation engine that preserves 100% of formatting,
mathematical formulas, tables, and typography geometry.
Maintained and developed by ThanhNguyxnOrg
π Demo Β· β¨ Features Β· π Quick Start Β· π» Usage Β· π 48 Languages Β· π€ Agent Skill Β· π Doc Hub Β· π Changelog Β· βοΈ License
Note
LayoutLingua is an open-source document translation platform available for Windows, macOS, Linux, Android, and command-line environments. It parses page geometry, isolates formulas and technical code blocks, translates prose through high-accuracy neural engines, and writes the translated content back to exact spatial coordinates without converting documents into plain text.
- π― Strict Layout Preservation: Keeps paragraph bounding boxes, formulas, tables, figures, tables of contents, and references intact.
- π Universal Multi-lingual Recognition: Deep isolation of technical formulas in documents written in Vietnamese (with full tone marks), CJK (Chinese, Japanese, Korean), Cyrillic (Russian, etc.), Arabic, Hebrew, and European Latin alphabets.
- π¦ 4 Native Platforms: Ready-to-use binaries for Windows, macOS (Apple Silicon & Intel), Linux (x86_64), and Android.
- β‘ Ready Out of the Box: Download, extract, and run. Packaged desktop releases do not require Python or manual model downloads.
- π Batch Processing: Drag and drop multiple files or entire folder trees into the processing queue.
- π‘οΈ Resilient Batch Execution: A damaged or unsupported file logs an error and continues without stopping the rest of the queue.
- π Background Auto-Updater (Windows): Checks for new releases in the background, downloads updates, and stages safe seamless swaps.
- π± Native Android Companion: Lightweight Android application powered by PDFBox-Android and Google Translate for on-the-go reading.
- π€ AI Agent Skill Mode: Built-in Handoff mode adhering to the Agent Skills standard, allowing local LLMs (Codex, Claude Code, Copilot, Gemini) to translate domain-specific technical papers with full context awareness.
- Download LayoutLingua for Windows (
.zip). - Extract the archive completely.
- Run
LayoutLingua.exe.
Tip
Windows builds include a background auto-update worker that notifies you whenever a new release is published.
- Download the installer for your Mac architecture:
- Open the
.dmgfile and drag LayoutLingua to your Applications folder. - On first launch, right-click the app icon β Open β Open.
- Download LayoutLingua for Linux (
.tar.gz). - Extract and launch:
tar -xzf LayoutLingua-linux-x86_64.tar.gz cd LayoutLingua && ./LayoutLingua
- Download APK from the latest release (
LayoutLingua-android-*.apk). - Install the APK on your device (Android 8.0+ supported).
To build Android from source:
cd android
./gradlew assembleDebug- Drag and drop PDF files or folders directly onto the application window.
- Or click Select Files / Select Folder.
- Select your target language from the dropdown menu (48 languages supported across Latin, CJK, Cyrillic, Semitic, Greek, Thai, and Hindi).
- Click Translate. Each file displays live per-page progress.
- Results are saved into a
translated/subfolder next to each input file:Documents/ βββ research-paper.pdf βββ translated/ βββ research-paper-en.pdf
LayoutLingua does not merely present a list of language codesβeach language tier is backed by verified font routing, ink metrics, and formula boundary protection to prevent missing glyphs (tofu boxes) and overlapping lines:
| Tier | Language / Script | Engine & Font Routing | Calibration & Precision Details |
|---|---|---|---|
| Tier 1: Precision Calibrated | Vietnamese (vi) |
Times New Roman / Segoe / GoNoto | Calibrated ink metrics (strict 1.10 line-height floor) preventing stacked tone mark collisions (α», α», αΊ); stable rotated table header terminology. |
English (en) |
Standard Latin / System Serif | Baseline reference standard; grammar-aware LaTeX placeholder permutations; zero formula corruption. | |
Chinese (zh, zh-tw) |
SourceHanSerif{CN,TW} + System CJK |
Explicit zh-CN (Simplified) & zh-TW (Traditional) API routing; 1.4 line-height multiplier for dense Hanzi glyphs. |
|
Japanese (ja) |
SourceHanSerifJP + Meiryo/YuGoth |
Kanji, Hiragana, Katakana support; 1.1 line-height multiplier; Japanese punctuation handling. |
|
Korean (ko) |
SourceHanSerifKR + Malgun |
Hangul syllable blocks; 1.2 line-height multiplier; syllable boundary word wrapping. |
|
| Tier 2: Unicode Latin | European Languages (FR, DE, ES, IT, PT, NL, PL, CS, SV, DA, NO, FI, HU, RO, TR...) |
GoNotoKurrent / Base14 fonts | Full coverage for all extended Latin diacritics (Γ‘, ΓΆ, Γ§, Ε, Γ±, Ε, Ε); automatic hyphenation budget & width fitting. |
| Tier 3: Script-Routed | Cyrillic (ru, uk, bg) |
Google Noto Kurrent / DejaVu | Calibrated 0.8 line-height with 0.75 leading floor; Cyrillic prose regex isolation (\u0400-\u04FF). |
Semitic / RTL (ar, he) |
Google Noto Arabic / Hebrew | Hebrew code normalization (he β iw); bidirectional character range isolation in tokenizer. |
|
Greek (el), Thai (th), Hindi (hi) |
Google Noto specialized fonts | Dedicated Unicode range protection in prose parser (\u0370-\u03FF, \u0E00-\u0E7F, \u0900-\u097F). |
LayoutLingua follows the Agent Skills specification and integrates directly into AI coding tools (Claude Code, Codex, GitHub Copilot, Antigravity).
The skills CLI pulls directly from GitHub repositories or local directories (no npm publishing required):
# Install directly from GitHub:
npx skills add ThanhNguyxnOrg/LayoutLingua -g --all
# Or install from a local clone (offline / dev):
npx skills add . -g --allIn your agent session or terminal:
/layout-lingua translate document.pdf into English
| Mode | Engine | Best Suited For |
|---|---|---|
| Google (Default) | translate.google.com |
Rapid batch translation without API tokens |
| Handoff | Active AI Agent Session | Technical papers, specialized terminology, high accuracy |
Note
In Handoff mode, translatable text is extracted to JSONL chunks, translated by the LLM in context, and rebuilt back into the PDF with exact formula markers preserved.
All technical specifications, development workflows, and platform architectures are organized in modular documents:
| Topic & Guide | Focus Area | Status / Target |
|---|---|---|
| π οΈ Developer & CI/CD Guide | Core translation pipeline, local setup, test runner, GitHub Actions CI & release trigger | |
| π Architecture & Vision Roadmap | Formula tokenization manifold, BabelDOC CJK engine integration & olmOCR vision model | |
| π± Android Build & Release Guide | Gradle compilation, PDFBox-Android integration, APK signing & distribution | |
| π Web Architecture Blueprint | Scalable browser/cloud translation service, WebAssembly & worker pools | |
| π§ Agent Knowledge Base | AI assistant context, invariant rules, test regression history & domain patterns | |
| π‘οΈ Preservation Rules Reference | Mathematical symbol matrices, regex tokens, non-prose grammar invariants | |
| π€ Agent Skill Specification | Command schema, skill definition, dual-engine CLI workflows for AI pair programmers | |
| π Changelog & Version History | Comprehensive release notes, migration paths, and version audit logs |
LayoutLingua is open-source software released under the AGPL-3.0 License.
Maintained with β€οΈ by ThanhNguyxnOrg.

