EPUB to PDF Converter
Convert any EPUB e-book to a printable PDF entirely in your browser. The spine order, chapter titles, and inline images are preserved; the file never leaves your device. Pick page size, font, and margin — sources cited below.
How it works
An EPUB is a ZIP archive containing XHTML chapter files, optional CSS, fonts, and images, plus a small set of XML manifests that describe the reading order. The W3C's EPUB 3.3 Recommendation locks down the structure: the first file in the archive is the uncompressed text application/epub+zip (the OCF mimetype sentinel), then META-INF/container.xml points at the OPF package document, and the package document's spine declares the chapter order. This tool walks that structure deterministically:
- Read the ZIP central directory. A handwritten parser locates the End-of-Central-Directory record by scanning backward from the end of the file (PKWARE APPNOTE.TXT §4.3.16), then walks each Central Directory File Header to enumerate the entries. ZIP64 containers are flagged with a friendly error instead of silently mis-parsed.
- Decompress entries on demand. The browser's native
DecompressionStream("deflate-raw")handles compression method 8 (DEFLATE) — the only compressed method EPUBs use. Stored entries (method 0, including the mimetype sentinel) are copied byte-for-byte. No third-party ZIP library is loaded. - Parse the OPF spine. The package document's
<manifest>lists every resource in the book; the<spine>lists the reading order. Items withlinear="no"are excluded — those are typically pop-up notes the reader does not want printed. - Stitch the chapters into one document. Each chapter's body content is concatenated into a single HTML document with a CSS Paged Media
@pagerule for the chosen size and margin. Scripts, custom CSS, and event-handler attributes are stripped so nothing executes inside the sandboxed preview iframe; a curated print stylesheet replaces them so the output is consistent across books. - Print to PDF natively. The assembled document is rendered in a sandboxed same-origin iframe, and
iframe.contentWindow.print()opens the browser's print dialog. Picking Save as PDF writes the PDF directly to disk — selectable text, working hyperlinks, no rasterisation.
Two independent estimators compute the expected page count: a layout formula based on the chosen page size, font size, and margin, and a density formula tuned to the canonical 250-words-per-A5-page ratio that publishers use for paperback planning. Both numbers are shown above. When they disagree by more than 30%, the UI flags it so you can sanity-check before printing.
Worked examples
Frequently asked questions
Sources & references
- W3C — EPUB 3.3 (Recommendation, 25 May 2023): package document, OCF container, spine
- W3C — EPUB 3.3 §6 Open Container Format (mimetype sentinel rules)
- PKWARE — .ZIP File Format Specification (APPNOTE.TXT 6.3.10)
- W3C — CSS Paged Media Module Level 3 (Working Draft) — @page rules and margins
- MDN — DecompressionStream API (deflate-raw token for raw DEFLATE streams)
- ISO 216 — A-series paper sizes (A4, A5, B5)
Specifications and the dependency list were last cross-checked on 2026-05-11. The page is re-verified annually or whenever EPUB ships a minor revision — whichever is sooner.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found an EPUB the converter chokes on, or a feature it should support?
Email me at [email protected] — most fixes ship within 24 hours.