How to Convert PDF to EPUB on Linux (Browser & Command Line)
On Linux, you have two good options for converting PDFs to EPUB: use the toolkit.bot web app in your browser (no install), or call the toolkit.bot API from the command line with curl or Python. Both methods work on any distro — Ubuntu, Fedora, Debian, Arch — without any special packages.
Option 1: Browser-based (no install, any distro)
- Open toolkit.bot/pdf2epub in Firefox or Chromium
- Drag your PDF onto the upload area or click to browse
- Wait 10–60 seconds
- The EPUB downloads automatically
This works identically on Linux, macOS, and Windows. No packages required. The free tier includes 5 conversions per month — no account needed.
Option 2: Command line with curl
The /convert endpoint accepts a multipart PDF upload and returns the EPUB file directly.
curl -s -X POST https://toolkit.bot/convert -F "file=@your-document.pdf" -o output.epub
Replace your-document.pdf with the path to your file. The converted EPUB is saved as output.epub.
Batch convert a directory of PDFs
for f in *.pdf; do
echo "Converting $f..."
curl -s -X POST https://toolkit.bot/convert -F "file=@$f" -o "${f%.pdf}.epub"
sleep 2 # stay within free tier rate limits
done
This loops over all PDFs in the current directory and saves each EPUB alongside the source file. The sleep 2 avoids hitting rate limits on the free tier.
Option 3: Python script
Use the requests library for more control — error handling, retries, progress logging:
import requests
from pathlib import Path
def convert_pdf_to_epub(pdf_path: str, output_path: str = None) -> str:
pdf = Path(pdf_path)
out = Path(output_path or pdf.with_suffix(".epub"))
with open(pdf, "rb") as f:
resp = requests.post(
"https://toolkit.bot/convert",
files={"file": (pdf.name, f, "application/pdf")},
timeout=120,
)
if resp.status_code == 402:
raise RuntimeError("Free tier limit reached (5/month). Visit /pricing.")
resp.raise_for_status()
out.write_bytes(resp.content)
print(f"Saved: {out}")
return str(out)
# Usage
convert_pdf_to_epub("paper.pdf")
convert_pdf_to_epub("thesis.pdf", "thesis_epub.epub")
Option 4: Calibre (local, offline)
If you need unlimited offline conversions with no network dependency, Calibre is the standard Linux option:
# Install
sudo apt install calibre # Debian/Ubuntu
sudo dnf install calibre # Fedora
sudo pacman -S calibre # Arch
# Convert
ebook-convert document.pdf document.epub
Calibre works well for simple single-column documents. It does not handle scanned PDFs (no OCR) and often garbles multi-column layouts. For academic papers or scanned documents, the toolkit.bot API is more reliable. Calibre vs toolkit.bot comparison →
Which method should you use?
- Browser — quickest for one-off conversions, any distro, no setup
- curl loop — good for batch work with simple shell scripts
- Python — best for integration into existing pipelines with error handling
- Calibre CLI — best for unlimited offline batch conversion of simple documents
For scanned PDFs and academic papers on Linux, toolkit.bot (browser or API) is the most reliable option because Calibre lacks OCR and column detection. Full Python API documentation →
Try it from the browser or copy the curl command above.
Convert PDF to EPUB →