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

Source: https://epubcc.com/answers/page-numbers-in-the-middle-of-epub-text/ (updated 2026-11-04)

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.

## 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.

**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.
