Add Header and Footer to PDF

Add a running header or footer with page numbers. Text is drawn inside your browser; the file never leaves it. Chinese, Japanese and emoji all work — they are rendered as crisp images, which means the header text cannot be selected or searched afterwards.

⇪

Drop a PDF here, or click to choose

Single file, up to 100 MB

About the divider line: it is drawn at a fixed offset from the page edge, so pages with different margins will not have it at the same place relative to the text block. If the document already prints its own header, adding another will overlap it.

About Add Header and Footer to PDF

Adds a running header or footer to every page, with six independent slots: left, centre and right for the header, and the same for the footer.

Why this deserves its own tool

Once a printed document is bound and later comes apart, the only thing saying which document a sheet belongs to is the line of small text in the footer. Formal material — reports, contract annexes, filings — almost always requires a page number and a document identifier on every page. Adding them in Word and re-exporting usually shifts the layout; a scan has no chance at all. This tool adds them directly to the PDF and leaves the existing layout alone.

How the placeholders work

Four tokens are substituted on each page:

  • {page} the current page number
  • {total} the page count
  • {title} the title from the PDF metadata (empty if there is none)
  • {date} today's date, as 2026-11-23

{page} / {total} in the footer centre is the common case and produces "3 / 12".

Why Chinese works but cannot be selected

pdf-lib's built-in fonts only cover Western encodings and throw on Chinese text. The approach here is to draw the text onto a high-resolution transparent canvas (4 pixels per point, sharp enough for print) and place that image on the page.

The cost has to be stated: text added this way cannot be selected, searched, or extracted as a text layer. Latin-only text automatically takes the vector route (sharp and selectable); only strings containing Chinese, Japanese or emoji are rasterised. Purely English documents are unaffected.

If the footer must remain searchable — for OCR archiving, say — add it in the source document before exporting instead.

The divider line

When enabled, a 0.5 pt line is drawn below the header text and above the footer text, in the text colour at 65% opacity, so it does not compete with the body.

The line sits at a fixed distance from the page edge. If the original pages have inconsistent margins, the line will sit at slightly different distances from the text block — that is geometry, not a bug.

It adds, it does not replace

If the document already prints its own header, the new layer is drawn on top and the two will overlap. Remove the old one in the source, or do not use this tool.

Frequently asked questions

Will Chinese in the header come out garbled?

No. Text containing Chinese is automatically drawn as a high-resolution image and placed on the page. The cost is that this text cannot be selected or searched, because it is an image rather than a text layer.

Why is my English header selectable but the Chinese one is not?

Latin text takes the vector route (the built-in font covers Western encodings); Chinese takes the image route. The choice is automatic, but searchability differs.

Can I add it to only some pages?

Yes. Put a range in Pages, e.g. 2-10. There is also a "skip first page" option — covers usually should not carry a page number.

Does {page} follow the numbers already printed on the pages?

No. {page} is the page index within the PDF, counting from 1. Numbers printed on the original pages are part of the content and cannot be read or changed.

What if the document already has a header?

They will overlap. The new one is drawn on top and both remain. Remove the old one in the source document first.

Is my file uploaded?

No. Reading, drawing and exporting all happen in your browser.

Related tools

PDF View all ›