ConverText CLI: Command-Line Text & Ebook Format Converter
In 2026 why are the most popular ereaders unable to read all the most popular text and ebook formats while also not offering easy ways to convert between them? Why are PDF files so difficult to edit? Does excessive use of HTML and Markdown cause carpal tunnel syndrome? I don’t have to think about these things anymore and neither do you! ConverText is here to convert any text, document and ebook formats into each other and send them where you want them on your computer or a remote drive with one CLI command or a few clicks.
Features
- Converts between 12+ text, document, and ebook formats
- Batch processing for entire directories with glob patterns
- Metadata preservation (title, author, structure)
- Lightweight and fast with no external dependencies for basic conversions
- Multiple layers of configuration including recursive per folder
- Available as CLI for people who prefer to type or script and standalone app for Mac/Win/Linux for people who prefer to click (Win and Linux still in beta, testers welcome).
Installation
Install via pip (Python 3.9+ required):
pip install convertext
PyPI Package: https://pypi.org/project/convertext/
GitHub Repository: https://github.com/danielcorsano/convertext
Requirements
- Python 3.9 or higher
- No external dependencies for basic conversions (pure Python)
- Optional: Pandoc for advanced Markdown features
- Supports macOS, Windows, Linux
Features
Input formats (12):
- Ebooks: EPUB, MOBI, AZW, FB2
- Documents: PDF, DOCX, DOC, ODT, RTF
- Text: TXT, Markdown, HTML
Output formats (6):
- Ebooks: EPUB, MOBI, FB2
- Text: TXT, Markdown, HTML
Additional capabilities:
- Batch processing: Convert entire directories with glob patterns
- Metadata preservation: Keeps title, author, chapter structure where supported
- Scriptable: Integrate into automation workflows
- Configuration files: YAML config for complex conversion rules
- Lightweight: No GUI overhead, runs entirely offline
- Fast: Pure Python implementation optimized for speed
Usage Examples
Basic conversion:
convertext input.pdf output.epub
Batch conversion:
convertext "documents/*.docx" output_dir/ --format markdown
Preserve metadata:
convertext book.pdf book.epub --preserve-metadata
With configuration file:
convertext input.pdf --config conversion.yaml
Convert entire library:
convertext "library/**/*.pdf" ebooks/ --format epub --recursive
Specify output format explicitly:
convertext document.docx output.txt --format txt
Configuration Files
Create a conversion.yaml for complex setups:
input_format: pdf
output_format: epub
preserve_metadata: true
output_dir: ~/converted/
Then run:
convertext book.pdf --config conversion.yaml
Format Support Matrix
| Input → Output | EPUB | MOBI | FB2 | TXT | Markdown | HTML |
|---|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | |
| EPUB | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| MOBI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| DOCX | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| TXT/MD | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
📸 Screenshot: Terminal showing convertext batch converting a directory of PDF files to EPUB with progress
Advanced Usage
Recursive directory processing:
convertext "library/**/*.pdf" --format epub --recursive --output-dir converted/
Custom Pandoc options (if installed):
convertext input.md output.epub --pandoc-args="--toc --css=style.css"
Dry run to preview conversions:
convertext "*.pdf" --dry-run --format epub
Consider Supporting
I created this alone, and it will be free and open source forever. For issues and feature requests please use GitHub. If you find it useful, please consider supporting me so I can improve this tool and create more.