Convert PDF to EPUB without losing formatting

Most PDF to EPUB converters turn a nice book into a mess of broken lines and stray page numbers. Here's why that happens, what "keeping the formatting" really means for an ebook, and how to get a clean result.

Your PDF is deleted right after conversion. No sign-up, no email.

Drop a PDF here

Free · no sign-up · text-based PDFs up to 30 MB and 600 pages

Why conversions usually go wrong

A PDF doesn't know what a paragraph or a chapter is. It only stores where each piece of text sits on a fixed page. A converter has to rebuild the book's structure from those positions, and simple converters get it wrong in predictable ways:

  • Every line becomes its own paragraph, so the text is chopped up at the width of the original page.
  • Page numbers and running headers ("Chapter 3 · The Title", "142") appear in the middle of sentences, once per page.
  • Hyphenated words stay broken — "recog- nize" instead of "recognize".
  • Two-column pages get mixed, reading straight across both columns line by line.
  • Headings aren't recognized, so there's no usable table of contents.
  • Code and preformatted text lose their line breaks and indentation.

What "keeping the formatting" means in an EPUB

An EPUB is meant to reflow: the reader chooses the font and size, and the text adapts to the screen. So a good conversion doesn't copy the PDF's page design — it keeps what matters for reading:

  • the chapters and sections, as a table of contents,
  • paragraphs and lists,
  • bold, italics and superscripts,
  • code blocks with their indentation,
  • images and diagrams in the right place,
  • footnotes, collected at the end of each chapter.

If you truly need the exact page layout (a magazine, a comic, a form), keep the PDF — see EPUB vs PDF.

How Epubfy keeps it clean

Epubfy reads every page before converting anything:

  1. Layout analysis. It measures font sizes and styles, detects multi-column pages and finds text that repeats at the top and bottom of pages (headers, footers, page numbers).
  2. Structure detection. AI looks at samples of the layout and decides which styles are chapter and section headings. The plan is checked against the whole document, and anything that doesn't fit is corrected or dropped.
  3. Exact text copy. The text is copied word for word into paragraphs, with hyphenated line breaks rejoined. AI never writes or rewrites any text.

Before downloading, tap Read in browser to check the result. If the chapters look wrong, switch to basic mode, which uses font size alone to find headings.

Getting the best result

  • Start from the original PDF, not a printed-and-scanned copy. If you can't select text in it, it's a scan.
  • Use the full document. Repeating headers and footers are found by comparing pages, so very short excerpts give the converter less to work with.
  • Fix the title on the result screen — it's what your e-reader shows in the library.

Frequently asked questions

Can a PDF be converted to EPUB with the exact same layout?

Only as a fixed-layout EPUB, which is basically the PDF pages as pictures — the text no longer reflows, so it has the same problems on a small screen. A reflowable EPUB keeps the structure (chapters, paragraphs, emphasis, images) rather than the exact page design. That is what Epubfy creates.

Why does Calibre mess up my PDF?

Calibre is excellent for EPUB and other ebook formats, but PDF input is its weakest point: it has to guess paragraphs and headings from text positions, and page headers and numbers often end up in the text. Epubfy measures fonts, columns and spacing on every page and uses AI to recognize the heading structure, which avoids most of these problems.

Will tables and equations survive?

Simple tables made of text come through as text lines; tables and figures drawn as graphics are kept as images. Complex math is the hardest case for any converter — if a document is mostly equations, it is usually better to keep the PDF.

Does Epubfy change my text?

No. The words are copied from the PDF exactly. Only the layout changes: lines are joined into paragraphs, hyphenated line breaks are rejoined, and repeating headers, footers and page numbers are left out.

Related guides