Skip to main content
Back to BlogPDF Guides

How to Convert PDF to EPUB (and Why E-Readers Hate PDFs)

A PDF page is a fixed-size canvas — usually A4 or US Letter at 72 points per inch. An e-reader screen is 6 inches diagonal at 167 PPI. Shrinking a full PDF page to fit makes text unreadably small. EPUB solves this by making text reflowable. Learn the EPUB file structure (it is a ZIP with mimetype, META-INF/container.xml, OEBPS/content.opf manifest+spine, OEBPS/toc.ncx navigation, and XHTML chapters), why the mimetype file must be uncompressed and first in the ZIP, how PDF.js extracts text using Y-coordinate line detection, why each PDF page becomes a chapter instead of detecting real chapter boundaries, what EPUB 2.0 vs 3.0 means for compatibility, and why images, tables, and multi-column layouts do not survive the conversion.

The Toolbox TeamAugust 13, 20268 min read

The problem: PDF is the wrong format for small screens

A PDF page is a fixed-size canvas. The most common sizes are A4 (210 x 297 mm) and US Letter (8.5 x 11 inches). When you open a PDF on a 6-inch e-reader, one of two things happens. The reader shrinks the entire page to fit the screen — and a full A4 page rendered on a 6-inch display produces text at roughly 25 percent of its original size, which is unreadable for most people. Or the reader lets you zoom in, which means panning across the page line by line, scrolling vertically through each page, then re-panning for the next. Neither experience is reading. It is navigation.

EPUB exists to solve this. EPUB is a reflowable format — the text is not laid out at fixed positions. Instead, the e-reader renders text at whatever font size you choose, wraps it to the screen width, and paginates automatically. Turn the font size up and the text reflows. The number of "pages" changes. The reading experience adapts to the device — a 6-inch Kindle, a 10-inch iPad, and a phone all show the same text at comfortable sizes because the reader device handles layout, not the file.

The PDF to EPUB Converter extracts text from a PDF and packages it into a standard EPUB 2.0 file. The conversion runs entirely in the browser using PDF.js for text extraction and JSZip for EPUB packaging. Understanding what the conversion preserves (text) and what it discards (layout, images, tables, fonts) is the difference between a useful EPUB and a broken one.

Fastest path

Open the PDF to EPUB Converter, drag a PDF onto the upload area or click to browse. Enter a book title and author. Click Convert. The tool extracts text from each page, creates one chapter per page, packages everything into an EPUB 2.0 ZIP, and downloads the .epub file automatically. The conversion happens in the browser — no file is uploaded to a server.

What an EPUB file actually is

An EPUB file is a ZIP archive with a specific directory structure and a specific mimetype. If you rename a .epub file to .zip and extract it, you see:

mimetype                  ← uncompressed, must be first
META-INF/
  container.xml           ← points to the OPF file
OEBPS/
  content.opf             ← manifest + spine (the book's catalog)
  toc.ncxtable of contents navigation
  chapter_1.xhtml         ← actual content (XHTML per chapter)
  chapter_2.xhtml
  ...

The mimetype file contains the string application/epub+zip and must be stored uncompressed (no DEFLATE compression) and must be the first file in the ZIP. This is a hard requirement of the EPUB specification — e-readers check the first bytes of the file to identify it as an EPUB. If the mimetype is compressed or not first, some readers reject the file. The tool uses JSZip's compression: 'STORE' option for this file and compression: 'DEFLATE' for everything else.

META-INF/container.xml tells the reader where to find the package document — the OPF file at OEBPS/content.opf. The OPF file is the book's catalog. It has three sections:

  • metadata: title, author, language, unique identifier, date. The tool fills these from the inputs you provide (book title, author) plus a generated unique ID based on the current timestamp.
  • manifest: a list of every file in the book — each XHTML chapter, the NCX navigation file, and any images or stylesheets. Every file must be listed here or the reader will not load it.
  • spine: the reading order. Each entry references a manifest item by ID. The reader follows the spine to determine which chapter comes next when you turn the page.

The toc.ncx file (Navigation Control file for XML) provides the table of contents. E-readers use it for the chapter navigation menu — the list you see when you tap "Contents" on a Kindle or Kobo. The tool generates one navigation point per chapter (one per PDF page), labeled "Page 1," "Page 2," and so on.

How text extraction works

The tool uses PDF.js (page.getTextContent()) to extract text from each PDF page. PDF.js returns an array of text items, each with a string and a transform matrix that encodes position. The tool assembles these into lines by checking the Y-coordinate: when the Y position changes by more than 8 units between consecutive items, it inserts a line break. This is the same approach used by the PDF to PPTX converter, with a slightly larger threshold (8 units vs 5 units) because EPUB chapter text benefits from more aggressive line grouping — fewer, longer paragraphs read better on e-readers than many short fragments.

The extracted text for each page becomes one XHTML chapter. Text is split on newlines into paragraphs, each wrapped in <p> tags. HTML entities are escaped (ampersands, angle brackets, quotes) to prevent invalid XHTML. Pages with no extractable text (scanned pages, image-only pages) get a placeholder paragraph: "No text content on this page."

Why each page becomes a chapter

Real books have chapters defined by their structure — a heading followed by content until the next heading. PDFs do not encode this structure. A PDF page break and a chapter break are different things. A 300-page novel might have 20 chapters spread across those pages, with chapters starting mid-page and spanning multiple pages. Detecting chapter boundaries from a PDF requires heuristics: looking for text that matches chapter heading patterns ("Chapter 1," "Part Two"), checking for font size changes, or detecting page breaks following short centered lines. These heuristics are unreliable and vary by publisher.

The tool takes the pragmatic approach: one PDF page equals one chapter. This guarantees that no text is lost or duplicated (every page's text appears exactly once) at the cost of unnatural chapter boundaries. You will see "Page 47" as a chapter title even if page 47 is the middle of a paragraph. The NCX navigation lets you jump to any page, but the chapter titles are page numbers, not meaningful headings. For most users, this is acceptable — the goal is readable reflowable text, not perfect chapter structure. If you need real chapter detection, use Calibre's PDF-to-EPUB conversion on a desktop, which includes structural analysis tools.

What does not survive

The conversion preserves text. Everything else is discarded.

Images are not extracted. PDF.js getTextContent() returns only text items. A page with a figure and a caption produces the caption text without the figure. For academic papers, textbooks, and illustrated books, this is a significant loss. Extracting images requires rendering each page to a canvas (page.toCanvas()) and detecting image regions, which is computationally expensive and produces low-quality results for most PDFs.

Tables become flat text. A PDF table is positioned text fragments — the cell value "Q1" at position (100, 500) and "$1.2M" at (200, 500). The tool extracts these in reading order (top to bottom, left to right based on Y then X coordinates) and concatenates them into paragraphs. The tabular structure is lost. Cell values that were visually adjacent in a grid become a linear text sequence.

Multi-column layouts produce garbled text. The Y-coordinate line detection assumes a single column. In a two-column layout, text from the left column at Y=500 and text from the right column at Y=500 may be interleaved, because the tool reads by Y position without column awareness. A newspaper or academic paper with two columns will produce unreadable chapters.

Fonts, colors, and styling are not preserved. All text is rendered in Georgia serif at 1em with 1.6 line height — a generic reading style chosen for e-reader compatibility. Bold, italic, headings, and colored text from the PDF all become plain paragraphs. The chapter title ("Page N") is the only styled element.

EPUB 2.0 vs 3.0

The tool generates EPUB 2.0, not 3.0. EPUB 2.0 uses NCX for navigation and Dublin Core metadata. EPUB 3.0 adds HTML5 navigation (nav element), CSS3 support, multimedia embedding, SVG, and scripting. EPUB 3.0 is the current standard (published 2011, last revised 2023), but EPUB 2.0 has broader compatibility — every e-reader ever made supports it, including old Kindles, Nooks, and Sony Readers. EPUB 3.0 support is still inconsistent on older devices.

For text-only conversions, EPUB 2.0 is the right choice. The features added in 3.0 (multimedia, scripting, complex CSS) are irrelevant when the source is PDF text extraction. The tool's EPUB 2.0 output works on Apple Books, Kobo, Calibre, Google Play Books, and Amazon Kindle (via Amazon's send-to-Kindle conversion, which transforms EPUB to Kindle's KF8 format).

Gotchas

  • Scanned PDFs produce empty EPUBs. A scanned PDF is a series of images — there is no text content stream. Every chapter will contain the "No text content on this page" placeholder. You need OCR before conversion. Tesseract (free, command-line) or Adobe Acrobat's OCR feature can add a text layer to scanned PDFs. The tool does not include OCR because it is computationally expensive and requires either server-side processing or a WebAssembly port of Tesseract.
  • Large PDFs may crash the browser tab. The entire PDF is loaded into memory as an ArrayBuffer, and every page's text content is held simultaneously to build the ZIP. A 500-page, 50 MB PDF can exhaust browser memory on devices with less than 4 GB of RAM. The tool shows a progress bar but has no cancel button. For large PDFs, split the PDF first with the PDF Splitter, then convert each part.
  • The chapter titles are page numbers, not real headings. "Page 1," "Page 2," "Page 3" — these are what you see in the e-reader's table of contents. There is no heading detection. If the PDF has clear chapter headings ("Chapter 1: The Beginning"), they appear as the first line of text in the chapter body, not as the chapter title. You will need to edit the EPUB afterward (using Sigil or Calibre) to rename chapters if you want meaningful navigation.
  • Password-protected PDFs are not supported. PDF.js cannot parse encrypted PDFs without the password. The tool shows an error. You must remove the password protection first (open in a PDF reader, save without encryption, or use the PDF Password Remover to decrypt).
  • Kindle does not read EPUB directly. Amazon Kindle uses its own format (KF8/AZW3). You can send the EPUB to your Kindle using Amazon's Send to Kindle service (web or email), which converts it automatically. Or use Calibre on a desktop to convert EPUB to MOBI or AZW3. The tool notes Kindle compatibility via conversion in its info panel.

Summary

  • PDF is a fixed-layout format designed for printing. E-reader screens are too small for full PDF pages — text becomes unreadable or requires constant panning. EPUB solves this with reflowable text that adapts to screen size and font size. The conversion extracts text from PDF and packages it as EPUB.
  • An EPUB file is a ZIP with a specific structure: mimetype (uncompressed, first), META-INF/container.xml, OEBPS/content.opf (manifest and spine), OEBPS/toc.ncx (navigation), and XHTML chapter files. The tool generates EPUB 2.0, which has the broadest e-reader compatibility.
  • Each PDF page becomes one chapter. Chapter titles are page numbers, not real headings. Text is extracted using PDF.js with Y-coordinate line detection (8-unit threshold). Images, tables, fonts, colors, and multi-column layouts do not survive — only text is preserved.
  • Scanned PDFs produce empty EPUBs (no text layer — needs OCR first). Password-protected PDFs are not supported. Large PDFs may exhaust browser memory. Kindle does not read EPUB directly — use Send to Kindle or Calibre for conversion.
  • Use the PDF to EPUB Converter for text-heavy PDFs (novels, reports, articles), the PDF Merger to combine PDFs before conversion, the PDF Splitter to break large PDFs into manageable parts, and the PDF to PowerPoint Converter when you need slides instead of an e-book.