A Java application that automatically translates DRM-free EPUB files using DeepL's translation API while preserving the book's structure and formatting.
-
Copyright Compliance: This application should only be used to translate EPUB files that you legally own or have permission to modify. The authors of this software disclaim any responsibility for misuse or copyright infringement. Always respect intellectual property rights and applicable laws in your jurisdiction.
-
DRM-Free Only: This tool works exclusively with DRM-free EPUB files. It cannot and will not attempt to remove DRM protection from encrypted ebooks.
The application:
- Extracts DRM-free EPUB files and identifies translatable content (HTML/XHTML files)
- Translates text content using DeepL's powerful neural translation API
- Preserves the original book structure, formatting, images, and metadata
- Creates a new translated EPUB file with "_translated" suffix
- Supports progress tracking and resume functionality for large books
- Java 11 or higher
- A DeepL API key (see API Configuration)
- Go to the Releases page
- Download the latest
ebook-translator-{version}-all.jarfile from the Assets section - Optionally download the
.sha256file to verify the integrity
# Set your DeepL API key (option 1: environment variable)
export DEEPL_API_KEY="your-api-key-here"
# Run the application
java -jar ebook-translator-{version}-all.jar "book.epub" EN IT
# Alternative: Set API key as system property
java -DDEEPL_API_KEY="your-api-key" -jar ebook-translator-{version}-all.jar "book.epub" EN ITjava -jar ebook-translator-{version}-all.jar <epub-path> <source-lang> <dest-lang> [api-type] [output-dir]-
epub-path: Path to the EPUB file to translate- Can be absolute path:
/path/to/book.epub - Can be relative path:
./books/book.epub - Can be filename if in current directory:
book.epub
- Can be absolute path:
-
source-lang: Source language code (e.g., EN, DE, FR, ES, IT)- See DeepL Language Codes for full list
-
dest-lang: Destination language code (e.g., IT, ES, FR, DE, EN)- See DeepL Language Codes for full list
-
api-type(default: PRO): DeepL API typePRO: DeepL Pro API (faster, no rate limits)FREE: DeepL Free API (slower, with rate limiting)
-
output-dir: Directory where translated files will be saved- Default: Same directory as the input EPUB file
- Example:
/path/to/output/
# Basic usage (current directory)
java -jar ebook-translator.jar "book.epub" EN IT
# With specific API type
java -jar ebook-translator.jar "book.epub" EN IT FREE
# With custom output directory
java -jar ebook-translator.jar "book.epub" EN IT PRO "/home/user/translated-books/"
# Full path with all parameters
java -jar ebook-translator.jar "/home/user/books/book.epub" EN IT PRO "/home/user/translated/"The application features intelligent progress tracking that allows you to safely interrupt and resume translations:
- Creates a temporary working directory:
.ebook-translator-temp/{book-name}/ - Maintains a
progress.xmlfile tracking which chapters have been translated - If interrupted, simply rerun the same command to resume from where it left off
- Only untranslated chapters will be processed on resume
your-epub-directory/
├── book.epub # Original file
├── book_translated.epub # Final translated file (when complete)
└── .ebook-translator-temp/
└── book/
├── progress.xml # Translation progress tracker
├── input/ # Extracted original files
└── output/ # Translated files
- Resilient: Handles interruptions, network issues, or quota limits gracefully
- Efficient: Only processes untranslated content on restart
- Safe: Original files are never modified
- Clean: Temporary files can be safely deleted after completion
- Cost: Free tier with monthly character limit
- Speed: Slower due to built-in rate limiting (1 request per second)
- Quota: Limited characters per month
- URL: Uses
api-free.deepl.com - Best for: Small books, testing, personal use
- Cost: Paid subscription required
- Speed: Full speed, no artificial delays
- Quota: Based on your subscription plan
- URL: Uses
api.deepl.com - Best for: Large books, frequent use, production
- Visit DeepL API Plans
- Choose between Free or Pro plan
- Create an account and verify your email
- Go to your DeepL Account
- Navigate to the "API" section
- Copy your authentication key
Option 1: Environment Variable (Recommended)
# Linux/macOS
export DEEPL_API_KEY="your-api-key-here"
# Windows
set DEEPL_API_KEY=your-api-key-hereOption 2: System Property
java -DDEEPL_API_KEY="your-api-key" -jar ebook-translator.jar [options]DeepL supports many language pairs. Common codes include:
EN- EnglishDE- GermanFR- FrenchES- SpanishIT- ItalianPT- PortugueseRU- RussianJA- JapaneseZH- Chinese
For the complete list, see DeepL's Language Documentation.
# Clone the repository
git clone https://github.com/mess/ebook-translator.git
cd ebook-translator
# Build with Maven
./mvnw clean package
# Run the generated JAR
java -jar target/ebook-translator-*-jar-with-dependencies.jar [options]- Java: Version 11 or higher
- Memory: Minimum 256MB RAM (more for large books)
- Storage: Temporary space equal to ~3x the EPUB file size
- Network: Internet connection for DeepL API calls
This project is open source. Please see the LICENSE file for details.
Note: This tool is not affiliated with or endorsed by DeepL SE. DeepL is a trademark of DeepL SE.