Skip to content
Answer

Why does my EPUB show page numbers in the middle of the text?

Updated:

Your EPUB shows page numbers in the middle of sentences because the converter copied the PDF's page furniture (page numbers, running headers and footers) as if it were part of the text. The fix is a converter that detects text repeated at the top or bottom of the pages and removes it before joining the paragraphs.

Try 5 pages free

Fixed layout vs. reflowable text

Original PDF
A page of the original PDF: The 9/11 Commission Report (GPO)
EPUB
The same passage in the EPUB made by EpubCC
Real conversion from the case Removing repeated headers: the 9/11 Commission Report · The 9/11 Commission Report (GPO)

Why it happens

In a PDF, the page number and the running header ("Chapter 3", the book title, the author's name) are ordinary text, drawn on the page like everything else. A converter that reads the text in order puts "47 THE TITLE OF THE BOOK" between the last line of one page and the first line of the next, which is often in the middle of a sentence.

How EpubCC removes it

  • Short blocks in the top or bottom 12% of the page that repeat on at least 3 pages are treated as margins and removed, with digits and roman numerals normalised so "47" and "48" count as the same header.
  • A block that is only a page number is removed too.
  • For the free sample, the engine also reads up to 4 neighbouring pages on each side, only to detect headers, because odd and even pages often carry different headers that a 5-page sample would never see repeat.
  • After the margins are gone, a paragraph cut by the page break is joined again when the next page continues the sentence.

If you already have the EPUB

You can delete the numbers by hand in an EPUB editor, but on a long book it is faster to convert again from the PDF with a converter that handles margins. The benchmark measures margin leak, the share of repeated headers and page numbers left in the text, for every engine.

Evidence from the benchmark

Margin leak · Share of repeated running headers, footers and page numbers left in the text. Lower is better. Mean over the documents of the benchmark of November 3, 2026. Methodology and every result
EngineMargin leak
EpubCC engine (EPUB output)0.071
EpubCC engine (plain text)0.988
pdf_oxide · extract_text0.887
pdf_oxide · to_plain_text (XY-cut)0.794
pdf_oxide · Markdown0.102
PDFium · text().all()0.999
OpenDataLoader PDF (local mode)0.010
pdftotext (Poppler)0.046

Remove headers and page numbers
Convert up to 5 pages free, no account needed.

Size and page limits per plan

Share LinkedIn X Reddit Email

FAQ

Why does my EPUB show page numbers in the middle of the text?

Your EPUB shows page numbers in the middle of sentences because the converter copied the PDF's page furniture (page numbers, running headers and footers) as if it were part of the text. The fix is a converter that detects text repeated at the top or bottom of the pages and removes it before joining the paragraphs.

Can an EPUB keep the original page numbers?

Yes, as a page list: invisible markers that let a reader jump to printed page 47 without showing the number in the text. That is different from leaving the number in the middle of a sentence.

Why are some headers still left after conversion?

A header that appears on fewer than 3 pages, or that changes wording on every page, does not look repeated. Those cases are rare but possible.