Headers, footers and page numbers landed in the text after PDF to Word
By the getPDF team · Published 26 October 2026
The short answer
A PDF has no header or footer region: the running title and the page number are plain text drawn on every page, so a converter that copies everything puts them in the body 48 times. Our converter leaves them out (Running lines, on by default): a line in the top or bottom tenth of the page that repeats on most pages, and any lone page number. For a file you already have, one Find and Replace with wildcards strips them, and Insert, Header and Insert, Page Number put Word’s own back.
Try it here, nothing is uploaded
Why it happens
Open a PDF and look at the running title at the top of each page. To the file it is a line of text like any other, at a position near the top; the page number at the foot is the same. Nothing marks either as “repeat me”. Word has a header area that repeats a line on every page by itself, but a converter only gets that line if it recognises what it is.
Converters that do not, and copy-and-paste from a viewer, give you the title and the number between every page’s text. The test report has a running header on 6 pages and a page number on each; copied line by line, that is 12 stray lines.
What our converter does
Before it writes a word, the converter looks at every page’s top and bottom tenth. A line that repeats there, at the same height, on at least 60 % of the pages (3 pages or more) is a running line; so is any line that is only a page number, in any of the usual forms (3, Page 3, 3 of 6, 3 / 6). Both are left out. The count is in the result panel for PDF to Markdown (“Left out 12 running lines”), and PDF to Word uses the same rule.
The option is Running lines: left out, and it is on by default. Set it to kept when you want that text once, for a letterhead you will copy into Word’s own header, then delete the copies.
Two things it keeps on purpose: a first-page letterhead (it does not repeat), and a chapter name that changes from page to page (it does not match itself). The numbers are matched as a pattern, so Page 3 of 6 and Page 4 of 6 count as the same line.
Stripping them from a file you already have
Press Ctrl+H, click More, tick Use wildcards.
A header that is the same on every page. Find what: the header’s text followed by ^13 (the wildcard code for a paragraph mark), for example River survey 2026: field report^13. Replace with: nothing. Replace All.
Page numbers. Find what: ^13Page [0-9]{1,} of [0-9]{1,}^13 for the form “Page 3 of 6”; ^13[0-9]{1,}^13 for a bare number on its own line. Replace with: ^p. Replace All. Check that no real line is a bare number first (a table of figures could be).
A header that changes (a chapter name): there is no pattern to find. Search for the first words that every variant shares, and delete the lines one by one; a 48-page file takes 5 minutes.
Putting Word’s own back
Insert, Header, pick a layout, type the running title once. Insert, Page Number, pick top or bottom, left or right. Word repeats them on every page and renumbers when pages move, which the PDF’s fixed text never could. For a different first page (no number on the title page), double-click the header area and tick Different First Page.
If you need the header to say what the PDF’s said, convert once with Running lines set to kept, copy the line from page 1 into the header, and delete the rest with the Find above.
The honest part
The rule is statistical: it needs 3 pages and a line that repeats on 60 % of them at the same height. A 2-page letter keeps its footer, and a report whose running title moves up and down by more than 6 points from page to page keeps it too. When that happens, the Find above is the fix, and it takes a minute. The rule also removes something you might have wanted: a footnote that sits in the bottom tenth and repeats (a standard disclaimer) is treated as a footer and dropped; set Running lines to kept for that file.
Questions
Why is the header repeated in the middle of my text?
A PDF has no header area. The header is ordinary text drawn at the top of every page, so a converter that copies every line copies it on every page, and in Word it lands in the body between the pages' text.
How does getPDF's converter handle them?
A line in the top or bottom tenth of the page that repeats at the same height on 60 % of the pages, and any line that is only a page number, is left out. The option is called Running lines and is on by default; turn it off to keep them.
How do I remove them from a file I already have?
Ctrl+H with Use wildcards on. For a header that is always the same, find it with a paragraph mark after it and replace with nothing. For page numbers, find ^13Page [0-9]{1,} of [0-9]{1,}^13 and replace with ^p.
How do I put a proper header and page numbers back?
Insert, Header, pick a style, type it once. Insert, Page Number, pick a position. Both update themselves when pages move, which the PDF's never could.
The tools for this job
Keep reading
- How to convert a PDF to Word, and what to expect when you open the resultHow to convert a PDF to Word in your browser in 3 steps, free, nothing uploaded, and what comes across: tested on an invoice, a report, a CV and a paper.
- The converted Word file looks different: what changed, and the 5-minute fixesYour PDF to Word file looks different because page layout does not survive conversion.
- Edit a PDF header or footer on every page, in 1 passFix a wrong header or footer on every page of a PDF in 1 pass with find and replace, free and on your device.
- Every line is its own paragraph in Word: rejoin them in 2 minutesA paragraph mark after every line after PDF to Word comes from a converter that kept the lines.
- Add a header and footer to every page of a PDFAdd a header or footer to a PDF: a title, a date, the file name or a case number on every page, with page numbers if you like.
- Add page numbers that skip the cover pageAdd page numbers to a PDF that skip the cover, start at any number and sit where you want.
- PDF to Word, Excel and text for free: what converts, what breaks, and how to pickConvert PDF to Word, Excel, plain text, Markdown or CSV free in your browser.