Add Header and Footer to PDF

Add a header or footer to one PDF in your browser, without uploading it. Use automatic filenames, dates and page numbers, with 6–36 pt text.

Drop files here or choose files
One PDF up to 50 MB · processed in your browser · nothing is uploaded

Separate page numbers with commas and use a hyphen for a range, like 1,3,5-8. Leave it empty to stamp every page.

6–36 pt, 10 pt by default

Placeholders you can use:{filename}{date}{page}{total}

While the file is processed, {date} becomes today's date on this device, always as year-month-day — for example 2026-12-02.

How to use

  1. Choose one PDF: Drop a single PDF onto the box or click to pick it, up to 50 MB. Once the document has been read, the file row shows its page count, so you can check you opened the right one; press ✕ to swap it for another one.
  2. Write the header and footer lines: The header starts as {filename} on the left and the footer as {page} / {total} in the center. Edit either box, type your own text around the placeholders, and set Header position and Footer position to Left, Center or Right. One of the two lines may be left empty, but not both.
  3. Pick the pages and the size: Leave Apply to pages empty to stamp every page, or enter a list such as 1,3,5-8. Font size takes 6 to 36 pt and starts at 10 pt.
  4. Add the lines and save: Click Add header and footer, scroll the preview to check the first and last page, then download your-file-header-footer.pdf. On a phone, Save to device opens the system share sheet when the browser offers file sharing, and simply downloads the PDF when it doesn't.

How to add a header and footer to a PDF online, free

Add a header and footer to a PDF by choosing one file, entering your text and selecting all pages or a range such as 1,3,5-8. The tool creates a new PDF locally and leaves the original file unchanged.

The header starts out as {filename} on the left, the footer as {page} / {total} in the center, and the text at 10 pt. Both lines are optional on their own, but at least one of them has to contain something, and the file you download is named after the original with -header-footer added. Everything runs on your device: the PDF is read straight into memory in your browser, the pdf-lib library writes the stamped copy there, and the document itself is never sent anywhere — so you can add header and footer to PDF files without uploading contracts, payslips or ID scans.

The code that draws the two lines is only fetched when you press the button, and the work itself is fast because it is a drawing job rather than a conversion: no page is re-rendered or re-compressed, the text is simply painted over what is already there. In our Node test runs with the default settings, a five-page document took a couple of milliseconds and a 300-page document about 0.15 seconds; browser timings on a phone or laptop were not measured, so treat those figures as a sense of scale rather than a promise.

When the result appears it replaces the form, with the finished PDF shown in a preview frame. Check the first page, a middle page and the last page there — that is where a line that is too long or a page you forgot to include shows up. If something needs changing, press Start over, pick the file again and adjust the settings; the result lives only in this tab, so download it before you close the page.

Stamping several documents with one continuous page count? Join them with Merge PDF first, then add the header and footer to the combined file.

Placeholders: filename, date, page and total

Header: {filename}                      → quote-2026.pdf
Footer: {page} / {total}                → 3 / 12
Footer: {date} · Page {page} of {total} → 2026-12-02 · Page 3 of 12

Four placeholders are replaced while the file is being processed. Everything else you type is drawn exactly as it is, so a line like "Internal copy · {date}" comes out as "Internal copy · 2026-12-02", and a token this tool does not know — {invoice}, say — is painted onto the page with its braces intact.

To add filename to PDF header automatically, leave the default {filename} in the header box: it writes the name of the file you picked, extension and all, which is what makes a printed page traceable back to the document on your drive. To add page number and date to PDF footer, type {page} / {total} · {date} instead — or Page {page} of {total} if you prefer words. A placeholder can appear more than once in the same line, and you can mix them with ordinary text, dots, dashes and middots.

{page} is the page's position in the document, counted from 1, and it ignores which pages you chose to stamp: stamp only page 7 and the footer there still reads 7. {total} is the page count of the whole document, not the number of pages you stamped. The date comes from your own device clock and is always written year-month-day, so a laptop set to the wrong day stamps the wrong date.

Type thisYou get
{filename}The name of the file you chose, extension included, for example quote-2026.pdf
{date}Today's date on this device, always as year-month-day: 2026-12-02
{page}The page's own number, counting from 1 through the whole document
{total}The number of pages in the document

The braces matter; the capitalization does not — {Page} and {TOTAL} work too.

Where the text lands on the page

Both lines sit 24 pt in from the paper edge — that distance is fixed and there is no control for it on the page. The header's first line is placed one font size below that top margin; the footer's last line sits 24 pt above the bottom edge and extra lines grow upwards, keeping the bottom line where you expect it. Line spacing, when a line does wrap, is the font size multiplied by 1.3, so 10 pt text wraps onto lines 13 pt apart.

Left, Center and Right are measured against each page's own visible width, which is why a document mixing A4 portrait pages with a landscape spreadsheet still gets its footer centered correctly on both. Text longer than the usable width — the page width minus the 24 pt margin on each side — is wrapped by measuring the real width of each character: on a narrow 200 pt-wide test page, a 78-character English sentence came out as three lines. Only the width is checked, never the height, so a very long line at a large font size can keep wrapping until it runs off the paper. Keep the lines short, or drop the font size, if you are typing a whole sentence rather than a label.

Rotated pages are handled the way a reader shows them. A scan saved with a 90°, 180° or 270° rotation gets its header along the edge that looks like the top, reading horizontally, because the visible width and height are worked out first and the text is turned by the same angle. A page rotated by something that is not a multiple of 90° cannot be laid out, and if it is one of the pages being stamped the whole job stops with the character-and-rotation message; pages you left out of the list are never checked for rotation.

The lines are drawn on top of what is already on the page. Nothing is moved down, scaled or given extra white space, so a document whose text already runs close to the edges can end up with the stamp sitting over it. If the preview shows an overlap, reduce the font size, fill in only one of the two lines, or re-export the document from the app it came from with wider margins.

What the saved PDF keeps, and what changes

For PDFs with at least one page, the page count, dimensions and rotation are preserved. A 300-page file comes back with 300 pages, a landscape document keeps its 841.89 × 595.28 pt pages, a page saved with a 90° rotation keeps that rotation, and the original text and images are neither re-encoded nor turned into pictures — text you could select before is still selectable. A valid zero-page PDF is saved as one blank page without a header or footer. The header and footer are added as real PDF text too, not as an image: in our tests the stamped footers could be pulled straight back out again as "Page 1 / 5" through "Page 5 / 5" with our own PDF-to-text code, which also means a reader's search box finds them.

Two pieces of file information change, because the document is written out again: the Producer field becomes pdf-lib, and the modification date becomes the moment you pressed the button. Title, author, subject, creation date and Creator are left alone when the original already has them — and when one of those last two is missing, it gets filled in rather than staying empty.

Size usually barely moves. Plain ASCII lines add roughly a few tens to a couple of hundred bytes per stamped line, which only becomes visible on long documents; small files can even come out slightly smaller, because rewriting the document re-packs it. Characters outside ASCII cost more because a font has to be embedded, but only the glyphs you actually used are stored — around 2 KiB in our samples, not the 629 KiB of the whole font file.

Test filePages / originalHeader + footerChange
single-page.pdf1 page / 1,648 B1,710 B+62 B
normal.pdf (text only)5 pages / 4,052 B4,144 B+92 B
image-heavy.pdf (scan)4 pages / 845,087 B845,081 B−6 B
large.pdf300 pages / 183,711 B295,979 B+112,268 B

Measured in Node with the default settings: {filename} left, {page} / {total} centered, 10 pt, every page.

If the stamped file still has to fit an email or upload limit, run it through Compress PDF.

Limits, and what this tool cannot do

One PDF at a time, up to 50 MB, and PDF only. Drop several files onto the box at once and none of them is taken — the message tells you how many were turned away, so nothing is silently dropped. Once a file is chosen the drop area is gone; press ✕ on the file row to pick a different document. Each of the two lines holds up to 200 characters, and because the boxes are single-line you cannot press Enter for a second line — long text wraps by itself instead.

The built-in font covers Latin letters with their accents, plus Greek and Cyrillic. Chinese, Japanese, Korean, Arabic, Hebrew, Thai and emoji have no glyphs and stop the job with the message about characters that cannot be drawn. That check looks at the finished lines for every page of the document, not only the pages you selected, and it includes the file name whenever {filename} is in use — so a file whose name is written in Chinese characters fails even though you typed nothing but a placeholder. Rename the file, or type the heading yourself in Latin letters, digits and common symbols.

Plain ASCII text uses a standard PDF font and downloads nothing at all. The first character outside ASCII — an accent, a Greek letter, Cyrillic — triggers a one-off download of the Noto Sans font file, 629 KiB, before the subset is embedded. If that download is answered with an error page you get the same unsupported-characters message; if the connection drops instead, the generic "Something went wrong" line appears. Either way nothing is cached from a failed attempt, so pressing the button again once you are back online fetches it afresh.

A PDF that needs a password to open is refused with the password-protected message — open it in a reader, save an unprotected copy and stamp that. A damaged file, or a file that is not really a PDF, gets the invalid-file message.

There is no control for color (the text is a fixed dark gray, about #404040), for the typeface, for bold or italic, for the margin or for the line spacing; alignment and size are the two things you can change. There is also no three-part line — one left, one centered, one right on the same edge — so split those between the header and the footer, or run the file twice.

Date formats other than year-month-day are not available; type the date yourself if you need 2 December 2026.

And the stamp is ordinary PDF text: it is not a seal, it does not lock the document, and anyone with a PDF editor can select and delete it again.

Need a diagonal CONFIDENTIAL across the middle of the page rather than a line at the edge? Add Watermark to PDF does that job.

How this tool is checked

  • The logic behind this tool is covered by 31 automated test cases (hand-checked examples, edge cases and invalid input), and they run again before every release.
  • Before each release, a real browser opens this page, runs it on sample files (including a damaged one) and checks the file it produces.
  • Your files are processed in your browser and are never uploaded to our server.
  • Formulas, figures and definitions are checked against the sources listed at the end of this page.

How we build and test our tools →

Frequently asked questions

Is my PDF uploaded to a server?
No. The file is read into memory in your browser and the stamped copy is written there as well, so the document never leaves your device. That also means the result only exists in this tab — download it before you close the page.
Can the file name and the date be added automatically?
Yes. Type {filename} for the name of the file you chose, including its extension, and {date} for today's date on your own device, written as 2026-12-02. {page} and {total} give the page number and the page count, and the capitalization of the tokens does not matter.
Why am I told a character cannot be drawn?
The built-in font only covers Latin, Greek and Cyrillic letters, so Chinese, Japanese, Korean, Arabic, Hebrew, Thai and emoji stop the job. The check includes the file name behind {filename}, which is why a document whose name is written in Chinese characters fails even when you typed only placeholders. Rename the file or type plain Latin text.
Can I add a header and footer to only some pages?
Yes. Enter the pages in Apply to pages as 1,3,5-8, or leave the box empty to stamp every page. {page} keeps counting from 1 through the whole document, so page 5 still shows 5 even if it is the only page you stamped.
Can I change the font, the color or the margin?
No. The text is a fixed dark gray in a built-in typeface, 24 pt in from the paper edge, with line spacing of 1.3 times the font size. What you can change is the font size, from 6 to 36 pt, and whether each line sits left, center or right.
Will the new line cover something that is already on the page?
It can. The text is drawn on top and the page is never scaled or pushed down, so documents whose content already runs close to the edge may overlap. Check the preview, then reduce the font size or fill in only one of the two lines if the stamp lands on existing text.
Does adding a header and footer make the file much bigger?
Usually not. Plain ASCII lines cost roughly a few tens to a couple of hundred bytes per stamped line, so a 5-page test file grew by 92 bytes while a 300-page one grew by 112,268 bytes, about 110 KiB. Characters outside ASCII add a font subset of around 2 KiB.
Can someone remove the header and footer afterwards?
Yes. What you get is ordinary PDF text sitting on top of the pages, not a seal or a protection layer, so anyone with a PDF editor can select it and delete it. Nothing about the document's passwords, printing or copying permissions is changed either.

Add this tool to your website

Free for any website, personal or commercial. Paste the code where you want the tool to appear — it works on WordPress, Blogger, Google Sites, Notion and plain HTML.

<div class="gingertool-widget" data-embed="https://gingertool.com/embed/en/pdf/add-header-footer-to-pdf/" data-height="640" style="font-size: 13px; line-height: 20px; margin: 6px 0 16px; text-align: left">Add Header and Footer to PDF &#183; <a href="https://gingertool.com/en/pdf/add-header-footer-to-pdf/">Gingertool</a></div>
<script src="https://gingertool.com/embed.js" async></script>

Please keep the credit link below the tool. Embedded tools show no ads.

Step-by-step: Google Sites · Blogger · WordPress · Notion

Cite this tool

Using a result in a report, paper or assignment? Copy a ready-made reference.

APA
Gingertool. (2026). Add Header and Footer to PDF [Online tool]. Retrieved December 2, 2026, from https://gingertool.com/en/pdf/add-header-footer-to-pdf/
MLA
“Add Header and Footer to PDF.” Gingertool, December 2, 2026, https://gingertool.com/en/pdf/add-header-footer-to-pdf/. Accessed December 2, 2026.
BibTeX
@misc{gingertool-header-footer-pdf,
  author = {{Gingertool}},
  title = {Add Header and Footer to PDF},
  year = {2026},
  url = {https://gingertool.com/en/pdf/add-header-footer-to-pdf/},
  note = {Accessed: 2026-12-02}
}