PDF Header & Footer / Page Number Stamper
Add page numbers ("Page X of Y") and/or custom header text to every page of a PDF, with adjustable position and a start-at offset, entirely offline.
Result
A contract without page numbers is hard to reference in a meeting, a long report without a running header gets confusing once it's printed and the pages separate, and a cover page thrown into the count makes every page number off by one — this tool fixes all three directly in the browser, without uploading the file anywhere.
The footer is built from a template you type once: use {n} wherever the current page number should appear and {total} wherever the document's total page count should appear. Type just {n} for plain Arabic numbering (1, 2, 3…), or "Page {n} of {total}" for the familiar page-X-of-Y format — the same template is reused on every page, with both placeholders substituted per page. A start-at value lets numbering begin at any number instead of 1, which is exactly what's needed when a cover or title page shouldn't itself be counted as page one: set it to 0 and the first content page reads "Page 1".
A separate, optional header field adds the same static text — a document title, a client name, a confidentiality notice — to the top of every page, independently of the page-number footer. Both the header and the footer can be aligned left, center or right, and the tool computes the exact horizontal position from the page width and the font's own character metrics via pdf-lib, so centered and right-aligned text lines up precisely regardless of how long the string is or how wide the page is.
Under the hood, pdf-lib embeds a single Helvetica font once and draws the header/footer text directly onto each page — nothing is rasterized, and the rest of the document's content, fonts and images are left untouched. Because the built-in font only covers the Latin (WinAnsi) character set, accented Latin text works correctly but non-Latin scripts such as Cyrillic, Arabic or CJK text are not supported here and may render with missing or incorrect glyphs. Processing happens entirely on your device, so it's safe to use on contracts, theses, financial statements and any other document you'd rather keep off someone else's server.