Add Page Numbers to a PDF

Adding page numbers to a PDF writes a small text label, such as "3" or "Page 3 of 12", onto each page at a consistent position so readers and printers can keep long documents in order. This tool numbers the pages locally in your browser: you choose the position, the format, and the starting number, and the stamped file is saved back to your device without any upload. The original content is left untouched — only the number is added.

Add page numbers — runs on your device

How it works

Page numbers are not a native PDF feature — the format has no "header/footer field" the way a word processor does. A numbered PDF simply has the digits drawn onto each page as ordinary text. This tool does exactly that: it walks the document's page tree, and for each page appends a short text-showing sequence to the page's content stream, using a Helvetica font resource that is embedded once and referenced by every page.

Positioning is computed per page rather than assumed, because real-world PDFs mix page sizes: the tool reads each page's media box (its width and height in points, at 72 points per inch) and places the label relative to that box. A bottom-center number sits at half the page width, a fixed distance above the bottom edge; corner positions offset from the relevant edges. The text width itself is measured from the font's metrics so that right-aligned numbers stay flush as the label grows from "9" to "10" to "100" — without that measurement, three-digit numbers would drift off a right-hand margin.

The format options are string templates filled per page. "N of total" formats need the total page count, which the tool knows before stamping because the whole document is parsed up front; a custom starting number simply offsets the counter, so a chapter extracted from a larger book can begin at 45 and run to 78. Because the stamp is regular page content — not an annotation and not a form field — it prints on every printer, displays in every viewer, and needs no flattening. The one consequence to know about is that the numbers are permanent in the output file: like anything else in a content stream, removing them later means editing the PDF, so the tool never overwrites your original.

Worked example: numbering a merged board pack

An assistant merges five committee reports into one 86-page board pack, board-pack-oct.pdf, 3.9 MB. The source files each had their own numbering or none, so the merged pack needs a single clean sequence. Using the format "Page 1 of 86" at the bottom center, starting at 1, the stamping completes in about 1.2 seconds and the output is 3.92 MB — the growth is one shared font resource plus 86 short operator runs. Because two of the source reports were A4 landscape while the rest were portrait, the per-page media-box calculation matters: all 86 numbers sit exactly 24 points above the bottom edge and centered on pages of both orientations, which a fixed-coordinate approach would have gotten wrong on the landscape pages.

Frequently asked questions

Can I start PDF page numbering at a number other than 1?

Yes. Set the starting number option to any value, so the first page can be numbered 7, 45, or wherever your document sits inside a larger set. Each following page increments from there.

Will the numbers overlap text that is already on the page?

They can if the page has content in the chosen corner or margin, because the number is drawn on top of existing content. Pick a position that falls in white space, usually the bottom margin, or the outside corners.

What number formats are available for PDF pages?

You can stamp a bare number like 3, a n-of-total form like 3 of 12, or a labeled form like Page 3 of 12. The of-total variants are computed from the real page count of your file.

Does adding page numbers re-compress or degrade the PDF?

No. Existing page content, images, and fonts are untouched; the tool only appends a short text-drawing instruction and one shared font to the file. Visual quality is identical.

Are my files uploaded to number the pages?

No. The document is opened, stamped, and saved again by JavaScript in your browser, so the PDF never leaves your device. The tool also works offline once the page is loaded.

Can I remove page numbers that this tool added?

Not with a one-click undo: the numbers become part of the page content stream. Keep your original file, which the tool never modifies, and re-stamp from that if you want different numbering.

Related tools