DataSwap Fast file & data format converters, no signup

Add Page Numbers to PDF

Choose a PDF, set the position, starting number, and format, then add the numbers. Nothing you upload ever leaves your browser.

How this works without a server

Once you choose a PDF, this tool reads its raw bytes locally and hands them to pdf-lib, which embeds a standard Helvetica font into the document. For every page, it works out the number to show — offset by your starting number, and formatted as either a bare number or "Page X of N" — measures exactly how wide that text is at the chosen font size, and draws it as real vector text at the x/y position your chosen corner implies. It's the same text-drawing pdf-lib uses everywhere else: nothing is rasterized, and the rest of each page's content is left completely alone. The result is then packaged into a downloadable file with Blob and a browser download link — the file never touches a network.

Worked example

Say you have a 24-page report and want a page number in the bottom-right corner, starting at 1, in "Page X of N" format. Choose Bottom Right, leave Starting number at 1, pick Page 1 of N, and click "Add page numbers". Page one is stamped "Page 1 of 24" about 36pt in from the right edge and 24pt up from the bottom; page two gets "Page 2 of 24" in the exact same spot; and the last page reads "Page 24 of 24" — every page's number right-aligned to the same margin.

Frequently asked questions

Is my PDF uploaded anywhere?

No. The file is read locally with the browser's File API, and pdf-lib runs entirely in your browser tab to stamp the numbers and rebuild the file. Nothing is sent to a server, so contracts, reports, or anything private never leave your device.

Does this re-render or shrink my PDF's quality?

No. pdf-lib embeds a standard Helvetica font once and draws each page number as real vector text directly into that page's existing content — it doesn't rasterize the page into an image or re-compress anything already on it. Existing text stays selectable and every other element is untouched.

Can I make the numbering continue from a previous document, like page 45 instead of 1?

Yes — set "Starting number" to whatever the first page should read. If you set it to 45, the first page is stamped "45", the second "46", and so on, which is useful when this PDF is one chapter or section of a larger multi-file document that should keep counting.

What's the difference between the two number formats?

"1, 2, 3…" stamps just the page number by itself. "Page 1 of N" stamps the word "Page", the current number, "of", and the total page count — clearer for standalone documents like reports or contracts where readers want to know how many pages remain.