How to Add Page Numbers or a Reference to a PDF
Sometimes a PDF needs one small addition before you send it: "Page 2 of 5" at the bottom of each page, an invoice number in the top corner, or the case reference a court or council asked you to put on every sheet. You don't need to edit the document itself. You can place a line of text on top of each page and save a new copy.
Our Add Text to PDF tool does this in your browser. You add one text entry per page, set where it goes, and download the result. It works well for short documents. For a 60-page report it gets tedious, and we'll say when another tool is the better choice.
How the tool places text
Each piece of text you add is a "text layer": one line, on one page, at one position. To number a four-page document, you add four entries, one for each page. The text sits on top of the existing page, so it doesn't move or change anything that's already there.
Positions are measured in points, the unit PDFs use. One point is 1/72 of an inch, so 72 points is one inch, about 2.5 cm. Two numbers set the position:
- X is the distance from the left edge of the page.
- Y is the distance from the top of the page, and it marks where the bottom of your letters sits.
A standard A4 page is about 595 points wide and 842 tall. US Letter is 612 by 792. Those two sizes give you everything you need to work out the positions below.
Positions that work as a starting point
| Where you want the text | A4 (595 × 842) | US Letter (612 × 792) |
| Bottom centre (page number) | X 280, Y 815 | X 285, Y 765 |
| Bottom right (page number) | X 500, Y 815 | X 515, Y 765 |
| Top right (reference number) | X 400, Y 35 | X 415, Y 35 |
| Top left (reference number) | X 40, Y 35 | X 40, Y 35 |
These are rough values based on the page sizes, with a margin of about half an inch. Text placed this close to the edge can overlap a document's own header or footer, so check your file and adjust. Also, the text starts at X and runs to the right, so for a long reference in the top-right corner, lower X a little to keep it on the page.
Step by step: number a short PDF
Here's how to put "Page 1 of 4" through "Page 4 of 4" at the bottom centre of an A4 document.
- Open Add Text to PDF and click Choose PDF.
- Type
Page 1 of 4 into the Enter text box.
- Set Page number to 1, Font Size to around 10, and pick a colour. Black or dark grey looks most natural.
- Set X to 280 and Y to 815.
- Click + Add Text Layer. The entry appears in a list with its page, position and size.
- Change the text to
Page 2 of 4 and the page number to 2, keeping X and Y the same. Click + Add Text Layer again. Repeat for pages 3 and 4.
- Click Apply Text, then Download PDF. Your file is saved with
-with-text added to the name.
Open the download and check one page. If the number is a little too high or too low, note how far off it is. Click Reset, load the original again, and add the entries with the adjusted values. There's no live preview, so a quick test with just page 1 before you add the rest saves time.
Adding a reference or invoice number
The same steps work for a reference. Type something like Ref: INV-2026-0142 or Case no. 4471/26, set the page and position, and add a layer. If the reference should appear on every page, add one entry per page with the same text and position, just changing the page number.
A few common uses:
- A claim or policy number on each page of supporting documents, so pages that get separated can be matched again.
- A supplier's purchase order number on an invoice that was generated without it.
- "Copy" or "Draft" in red across the top, before you send a document for review.
- Today's date next to a signature line.
What the tool can and can't do
- It's manual. There's no automatic numbering. Each page needs its own entry, which is fine for a few pages and slow for dozens.
- One line per entry. Text doesn't wrap. For two lines, add two entries and move the second one down by a little more than the font size.
- One font. All text uses Helvetica, with no bold or italic.
- Latin characters only. Arabic, Urdu, Chinese, Cyrillic and emoji won't display.
- Page numbers past the end go on the last page. If you type page 9 in a five-page file, the text lands on page 5, so double-check your numbers.
- Password-protected PDFs may not open. Save an unprotected copy in your PDF reader first.
- It can't edit existing text. If the document already has wrong page numbers, this tool can only add new text on top, not remove the old ones.
Your file stays on your device the whole time. It's read and rewritten in your browser using the open-source pdf-lib library, and nothing is uploaded to our server. That makes it fine to use on contracts, tax forms or anything with personal details.
When to use something else
If you're numbering a long document, a tool with automatic page numbering will be much faster. Many full PDF editors include a header and footer feature that numbers every page in one go. If you made the document yourself in a word processor, the easiest fix is often to add page numbers there and export the PDF again.
If you're putting several files together, merge them first with PDF Merge, then add the numbers to the combined file, so the numbering runs straight through. And if the document also needs your signature, add the text first, then sign the result with PDF Sign.
KhanTools — Free Online Web Tools
Free browser-based tools for images and PDFs. No uploads. 100% private.
Blog ·
About ·
Privacy Policy ·
Terms of Service ·
Contact
JavaScript is required to use KhanTools. Please enable JavaScript in your browser.