AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert a PDF to an EPUB e-book?

Drop a PDF onto AnyTool PDF to EPUB and it extracts the text and assembles a valid, reflowable EPUB 3 e-book right in your browser. Using pdf.js, the tool reads the position and font size of every piece of text, rebuilds the lines, infers headings from relative font size, and merges soft-wrapped lines into flowing paragraphs. It then splits the document into chapters — by detected top-level heading, every N pages, or as a single chapter — and packs everything into a spec-correct EPUB with JSZip: the mimetype entry is written first and stored uncompressed, alongside META-INF/container.xml, an OEBPS/content.opf package (with your title, author, language and a freshly generated UUID), an EPUB 3 nav.xhtml plus an EPUB 2 toc.ncx fallback, a reflowable stylesheet and one XHTML file per chapter. Everything runs locally with a bundled pdf.js worker — no upload, no CDN, no server — so your PDF never leaves your device, and the .epub opens in Apple Books, Calibre, Kobo and Google Play Books.

  • Builds a valid, reflowable EPUB 3 from a PDF’s text layer in your browser
  • Headings inferred by font size; chapters and a table of contents generated
  • mimetype stored first, container.xml, content.opf, nav.xhtml + toc.ncx
  • Set the title, author and language; choose how chapters are split
  • 100% client-side — bundled worker, no CDN, no upload, works offline

What is

PDF to EPUB Conversion

PDF-to-EPUB conversion extracts the text from a PDF and re-expresses it as an EPUB — a reflowable e-book format that is a ZIP of XHTML, CSS and packaging files (mimetype, META-INF/container.xml, an OPF package document, and a nav/NCX table of contents). Unlike a fixed-layout PDF, a reflowable EPUB lets the reader change font size and the text re-wraps to any screen. Because a PDF stores only positioned glyphs and no semantic structure, a converter must reconstruct lines from each glyph’s coordinates and font size, infer headings and chapters, and emit valid XHTML; scanned (image-only) PDFs have no text layer and require OCR first.

Converters

Related terms

EPUBEPUB 3PDFpdf.jsReflowable E-bookOCR

Frequently Asked Questions

Nothing is uploaded. The PDF is read and the EPUB built entirely in your browser with a bundled pdf.js worker, so it never leaves your device.

AnyTool PDF to EPUB is 100% client-side. When you choose a PDF, your browser reads the file locally, pdf.js extracts the text on your own machine — using a worker bundled into the app rather than fetched from a CDN — and JSZip assembles the e-book in memory. No file is sent to any server, there is no account or tracking, and the tool keeps working offline after the first load, which makes it safe for confidential documents.

A real EPUB 3. The archive is built to spec — mimetype stored first and uncompressed, container.xml, an OPF package, and nav.xhtml plus a toc.ncx fallback.

The tool assembles a genuine EPUB 3 with JSZip. The required mimetype entry (“application/epub+zip”) is written first and stored without compression, as the spec demands. It adds META-INF/container.xml pointing at OEBPS/content.opf, a package document carrying the title, author, language and a freshly generated UUID identifier plus a dcterms:modified timestamp, an EPUB 3 nav.xhtml navigation document and an EPUB 2 toc.ncx fallback built from the chapter titles, a reflowable stylesheet, and one fully-escaped XHTML file per chapter. The result opens cleanly in Apple Books, Calibre, Kobo and Google Play Books.

By default it starts a new chapter at each detected top-level heading; you can also split every N pages or keep the whole book as one chapter.

A PDF doesn’t store chapters, so the tool infers them. It measures the document’s body font size and treats lines whose font is meaningfully larger as headings; in the default mode it begins a new chapter at each top-level heading and uses that heading as the chapter title and table-of-contents entry. If a PDF lacks clear headings, you can instead split into fixed chapters of a chosen number of pages, or keep everything as a single flowing chapter. Either way, each chapter becomes its own XHTML file and a navigable entry in the e-book’s contents.

No. A scanned PDF is page images with no text layer, so there is nothing to reflow — OCR is required first, and this tool does not OCR.

This converter reads a PDF’s existing text layer to build a reflowable e-book. A scanned or photographed PDF contains only images of the page, with no selectable text, so the tool detects that zero text was found and tells you the file looks scanned and needs OCR (optical character recognition) first. It also converts text only: images, exact fixed layout and tables are simplified or dropped in this text-first conversion. For normal, text-based PDFs the extraction is fast and the e-book is clean.

Detailed Explanation

Methodology

How the PDF to EPUB Converter Works

AnyTool PDF to EPUB reads a PDF entirely in the browser with pdf.js, whose worker is bundled into the app and served from the same origin — never loaded from a CDN — so the tool stays fully offline-capable and uploads nothing. A PDF stores no semantic document model, only positioned glyphs, so for each page the converter calls getTextContent() to obtain every text run with its position, font size and width, groups runs that share a baseline into lines, inserts spaces from x-gaps pdf.js omitted, and reconstructs the page. The document’s median font size is taken as the body text, and lines whose size is meaningfully larger are flagged as headings; soft-wrapped lines are merged into flowing paragraphs and hyphenated words are rejoined. The structured blocks are split into chapters — by detected top-level heading, every N pages, or as a single document — and each chapter is rendered as a fully XML-escaped XHTML file. JSZip then assembles a spec-valid EPUB 3: the mimetype entry (“application/epub+zip”) is written first and stored uncompressed as the spec requires, followed by META-INF/container.xml, an OEBPS/content.opf package document with dc:title, dc:creator, dc:language, a freshly generated UUID identifier and a dcterms:modified timestamp, an EPUB 3 nav.xhtml and an EPUB 2 toc.ncx fallback, a reflowable style.css, and one XHTML file per chapter.

  • Text read with pdf.js getTextContent() — position, font size, width
  • pdf.js worker bundled locally (pdf.worker.min.mjs?url) — no CDN
  • EPUB assembled with JSZip; mimetype written first and stored uncompressed
  • content.opf carries title, author, language and a generated UUID
  • nav.xhtml (EPUB 3) and toc.ncx (EPUB 2) built from chapter titles
How It Works

Chapters, Metadata and Output

The conversion is configurable. You can set the e-book’s title (defaulting to the PDF’s Title metadata, then the filename), its author and its language (a BCP-47 tag such as en, fr or es), and choose how the book is divided into chapters: start a new chapter at each detected top-level heading (the default, using the heading as both the chapter title and a table-of-contents entry), split into fixed chapters of a chosen number of pages, or keep the whole document as one flowing chapter. After conversion the tool reports the chapter count, total word count and the EPUB file size, and lists every chapter with a short text preview so you can verify the structure before downloading. The resulting reflowable .epub lets readers change font size and have text re-wrap, and opens in Apple Books, Calibre, Kobo and Google Play Books. A per-page progress bar keeps large PDFs responsive during extraction.

  • Editable metadata: title, author and BCP-47 language
  • Chapter modes: by heading, every N pages, or single document
  • Each chapter becomes an XHTML file and a navigable TOC entry
  • Chapter count, word count and file size reported with a preview
  • Per-page progress for large documents
Privacy & Security

Privacy and Honest Limitations

Because all extraction and EPUB assembly run in the browser with a locally bundled worker, the PDF is never uploaded, there is no account or tracking, and the converter works offline after first load — which makes it safe for confidential documents. The honest caveat is that this is a text-first conversion: the reflowable e-book contains the PDF’s extracted text only, so images, page graphics, exact fixed layout and tables are simplified or dropped, and chapters and headings are inferred from font size rather than read from real structure. Scanned or image-only PDFs have no text layer at all: the tool detects that zero text was found and clearly states that the file looks scanned and needs OCR, which it does not perform. Multi-column pages are read in geometric order and can interleave; the tool surfaces a warning when it detects a likely complex or multi-column layout.

PDF to EPUB: in-browser (AnyTool) vs typical online converters
CapabilityAnyToolTypical alternatives
ProcessingRuns in your browserUsually uploaded to a server
PrivacyPDF never leaves your deviceFile sent to a third party
Worker sourcepdf.js worker bundled locally — no CDNOften a remote CDN script
EPUB validitySpec EPUB 3: mimetype stored first, OPF, nav + NCXVaries; sometimes a renamed file
Chapters & TOCInferred by heading / N pages, navigable TOCOften one big flow, no TOC
ReflowableYes — text re-wraps to any screenSometimes fixed-layout
MetadataEditable title, author, language; UUIDOften generic or missing
Scanned PDFsDetected and flagged (needs OCR)Silent empty output
Works offlineYes (PWA)No
Cost / signupFree, no signupOften gated or ad-heavy

AnyTool extracts PDF text locally with pdf.js and a bundled worker and assembles a spec-valid EPUB 3 with JSZip, uploading nothing; chapters are inferred and the conversion is text-first, with images, fixed layout, tables and scanned PDFs flagged or simplified through honest warnings.