Skip to content
DevToolKit

PDF Header & Footer

Add custom headers and footers to every page of a PDF document. Supports dynamic page numbers, dates, filenames, and positional alignment. Runs locally in your browser.

pdf

Drop your PDF here, or click to browse

Files are processed entirely in your browser — never uploaded

Processed locally
Was this tool helpful?

How to Use

Add headers and footers to your PDF in four steps:

  1. Upload your PDF — Drag and drop the file or click the dropzone. The tool reads it locally and shows the page count and file size. No data leaves your browser.
  2. Enter header and footer text — Each row has three fields: left-aligned, centered, and right-aligned. Type static text or click the variable buttons to insert dynamic values like {{page}}, {{total}}, {{date}}, or {{filename}}.
  3. Configure style — Choose a font (Helvetica, Courier, or Times Roman), toggle bold, adjust font size (8-16 pt), set text color, and control margin distance from page edges. Enable "Skip first page" to leave the cover page clean.
  4. Apply and download — Click "Apply Header & Footer" to process the document. The preview shows how text will appear. Download the updated PDF when ready.

Variables are replaced per page. For example, entering Page {{page}} of {{total}} in the footer center produces "Page 1 of 10", "Page 2 of 10", and so on for each page.

About This Tool

Headers and footers are repeating elements placed at the top and bottom of every page in a document. In professional publishing, they serve as navigational aids that help readers identify the document, locate specific pages, and understand their position within a larger work. The three-position layout — left, center, right — follows the typographic convention established by academic publishers, legal firms, and corporate style guides, where each position serves a distinct informational purpose.

This tool uses pdf-lib, a JavaScript library that manipulates PDF structures directly in the browser. When you click "Apply Header & Footer," the tool embeds the selected font — Helvetica, Courier, or Times Roman — from the 14 standard PDF fonts guaranteed by the PDF specification (ISO 32000) to render identically in every compliant viewer. It then draws text at calculated coordinates on each page. Standard fonts ensure consistent glyph widths across platforms, which is critical for precise left/center/right alignment calculations. Bold variants are also available for each font family.

The margin parameter controls the distance between page edges and header/footer text, measured in PDF points (1 point = 1/72 inch). The default of 36 points equals 0.5 inches, a standard margin used in US Letter and A4 documents. For pages with existing content near the edges, increase the margin to prevent overlap. The tool reads the /Rotate flag from each page's dictionary to account for visually rotated pages — a landscape page that is structurally portrait (rotated 90 degrees in the PDF structure) will receive headers and footers at the correct visual positions.

Dynamic variable replacement occurs at processing time, not render time. The {{page}} variable uses 1-based numbering (the first page is page 1), matching the convention used by Microsoft Word, Adobe Acrobat, and Google Docs. The {{date}} variable captures the processing date in ISO 8601 format (YYYY-MM-DD), which is the internationally recognized date format recommended by W3C, the ISO standard body, and most corporate style guides for unambiguous date representation.

The "Skip first page" option leaves page 1 untouched while applying headers and footers to all subsequent pages. This is standard practice in academic theses (where the title page must be clean), corporate reports (where the cover page has its own design), and legal briefs (where the caption page follows specific court formatting rules that differ from the body). The page numbering variable still counts the first page — page 2 will display "2", not "1" — maintaining accurate page references throughout the document.

Why Use This Tool

Headers and footers serve critical roles across professional document workflows:

  • Legal document preparation — Court filings require specific header formats with case numbers, party names, and document titles. Footers carry page numbering in the format mandated by local court rules. Missing page numbers can result in filing rejections.
  • Academic and scientific papers — Journals require running headers with the author's last name, abbreviated title, and page numbers. Conference proceedings use footers for copyright notices and DOI references.
  • Corporate reports and proposals — Company name, confidentiality classifications ("CONFIDENTIAL", "INTERNAL"), and document version numbers appear in headers. Footers carry dates and page counts for version tracking.
  • Regulatory submissions — FDA, SEC, and patent filings require specific header/footer formats for document identification. The filename variable helps maintain traceability between electronic and printed copies.
  • Print preparation — Page numbers in footers ensure that printed documents can be reassembled in order if pages scatter. Headers with document titles help identify loose pages in multi-document print jobs.
  • Multi-author collaborations — When merging chapters or sections from different contributors, consistent headers and footers unify the document's appearance and provide readers with navigation cues.

Processing PDFs locally in your browser is important for sensitive documents. Legal briefs, financial reports, medical records, and personnel files should not be uploaded to cloud services. This tool ensures your documents never leave your device — no network requests, no server-side processing, no third-party data retention. Every byte stays under your control from upload to download.

FAQ

What dynamic variables can I use in headers and footers?
Four variables are available: {{page}} inserts the current page number (1-indexed), {{total}} inserts the total page count, {{date}} inserts the current date in YYYY-MM-DD format, and {{filename}} inserts the original PDF filename. Variables can be combined with static text, e.g., 'Page {{page}} of {{total}}'.
Can I skip the header and footer on the first page?
Yes. Enable the 'Skip first page' toggle to omit headers and footers from page 1. This is useful when your first page is a title page or cover that should not display running headers.
How are headers and footers positioned on the page?
Each header and footer has three positions: left-aligned, centered, and right-aligned. The margin setting (default 36 points = 0.5 inch) controls the distance from the page edge. Headers are drawn at the top margin, footers at the bottom margin.
Is my PDF uploaded to a server?
No. All processing runs locally in your browser using the pdf-lib JavaScript library. Your PDF never leaves your device, making this tool safe for confidential documents.
Will adding headers affect the existing page content?
The tool appends new drawing operations to each page without modifying existing content. Text remains searchable, images stay intact, and vector graphics are preserved. However, headers may overlap existing content near the page edges if the margin is too small.