Header & Footer

Put a running head along the top and a page count at the foot — six slots, filled in page by page as the file is stamped.

Runs on your devicePDFWorkingNo account needed

What this tool does

Header & Footer draws up to six lines onto each page you select: left, centre and right along the top edge, and the same three along the bottom. Each box holds a single line of text, empty boxes are skipped, and a run with all six left blank is refused rather than handing back a copy identical to the file you started with.

Those boxes accept placeholders, which is what turns a fixed caption into a running header. {page} becomes the number of the page being drawn, {total} the page count of the whole document, {date} today's date written the ISO way as year-month-day, {time} the clock time as hours and minutes, and {filename} the name of the file being stamped, extension included. The date and the time both come from your own device's clock. The names are not case-sensitive, and several carry spare spellings: {n} or {p} for the page, {pages} or {count} for the total, {file} or {name} for the filename. Two exceptions are worth knowing. {title} is understood by the same expander but has nothing to fill it here, so it resolves to nothing and the slot holding it draws no line at all. Any other word in braces — {section}, say — is left on the page exactly as you typed it.

One font, one size and one colour apply to all six slots in a single pass. The eight faces on offer are standard PDF ones: Helvetica, Times and Courier plain, a bold and an italic for Helvetica and for Times, and a bold for Courier — there is no Courier italic — sized from 4 to 48 point. Those faces carry the WinAnsi character set only, so Western European text draws as written while Greek, Cyrillic, CJK and emoji characters are substituted with a question mark instead of stopping the run. The margin figure is in millimetres and does two jobs: it is the distance from the top or bottom edge, and it is how far the left and right slots sit in from the sides.

The whole job runs in this browser tab using pdf-lib, so the document is not uploaded anywhere. The limitation worth planning around is that these lines are painted on top of the finished page and nothing underneath moves aside to make room. There is no wrapping and no shrink-to-fit either, so a line longer than the page keeps going straight off the edge. Neighbouring slots are positioned independently rather than measured against one another, so a long left entry and a long centre entry along the same edge will simply run into each other. Where the existing content already reaches into the margin band, the honest fix is to move the line nearer the edge, or to run Change PDF Page Size first with a margin set, which scales the page content inwards and leaves a clear strip to stamp into.

How to use it

  1. Add the PDF. One document or several. Each is stamped separately with the same settings and comes back named after its source with -headers added.
  2. Fill in only the slots you need. Header left, centre and right; footer left, centre and right. Two arrive already filled in — {date} in the header right and {page} / {total} in the footer centre — so clear the ones you did not ask for. Blank boxes are skipped, and at least one has to carry text before the run starts.
  3. Type the placeholders where they belong. {page} / {total} in the footer centre and {filename} in the header left is the usual pairing. {date} and {time} read your device clock at the moment you run it.
  4. Set the type and the margin. Choose one of the eight standard faces, a size between 4 and 48 point, a colour — the default is a grey #555555 that stays out of the way — and the margin in millimetres.
  5. Choose which pages are stamped. all, odd, even, a single number, a list such as 1,4,9, a range such as 2-9, an open range such as 4-, or the words first and last. A number past the end of the document is refused by name rather than quietly dropped.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Numbering a contract before it is signed

A footer centre reading {page} / {total} tells a reader at a glance whether a sheet is missing from the copy in front of them.

Dating drafts that circulate on paper

{date} in the header right means two printouts of the same report can be told apart on a desk, without opening either file to check.

Labelling a folder of scans

{filename} across the top keeps a printed stack traceable back to the file it came from, which survives the pages being separated.

Adding a running head to a long report

Put the section title in the header centre and name only the pages that section covers, then run a second pass for the next section.

Questions

Does the document leave this tab to be stamped?
No. pdf-lib reads the document into memory inside this tab, draws the text and writes the new file there, so nothing is transmitted or stored. The library is a plain file served from this site rather than a third-party CDN, so once the page has it in hand the stamping itself needs no network at all.
Can the page numbers start at something other than the physical page?
Not here. {page} is always the page's real position in the document, so stamping pages 5 to 20 prints 5 through 20, and {total} stays the full document count rather than the number of pages selected. Add Page Numbers carries a Start at field for the case where the printed folio has to differ from the position.
Why did some characters come out as question marks?
The standard PDF fonts used here cover the WinAnsi set only. A character outside it — Greek, Cyrillic, Chinese, most emoji — is replaced with a question mark so the rest of the line still draws rather than the job failing on one glyph. An emoji is held as two code units and therefore leaves two question marks behind. A tab becomes two spaces, while accented Western European letters, curly quotes and the long dashes all come through as written.
Can the header be bold while the footer stays small and grey?
Not in one pass. Font, size and colour are single settings shared by all six slots. Run the tool twice instead: once with the header boxes filled in, then again over the result with the footer boxes. The second output picks up a second -headers in its name, and a {filename} stamped on that pass reads the intermediate file rather than the original.
Does this replace headers the document already has?
No. Anything already printed at the top or bottom is ordinary page content and stays exactly where it is, with the new line drawn over it. Check one page before committing the whole document if the original prints something in the same corner.
Can I take the headers off again later?
Once stamped, the text is page content like any other rather than a removable layer, so this tool cannot lift it back off and no undo is kept between runs. Keep the original file if a clean copy may be needed later.
What happens with rotated or password-protected pages?
A page carrying a rotation flag is measured in the orientation it displays at, so the header still lands along the edge that reads as the top. An encrypted document cannot be opened at all and is refused with a message pointing at Unlock PDF.

Related tools

  • Merge PDF — Combine several PDFs into one document in the order you choose.
  • Split PDF — Split one PDF into separate documents by page range.
  • Compress PDF — Reduce PDF file size while preserving the quality that matters.
  • PDF to JPG — Export every page of a PDF as a JPG image.
  • JPG to PDF — Turn one or many JPG photos into a single PDF.
  • Protect PDF — Add a password and set permissions on a PDF.