Add Page Numbers to PDF
Operator: Abdulla Al Fahad. How tools are built and checked
The stamp this tool adds is deliberately plain: Helvetica in dark grey at 9, 11 or 14 points, set half an inch in from the edge you choose, in one of four formats from a bare 3 to Page 3 of 12. Plain is what page numbers should be on a contract, a thesis or a bundle of exhibits, and because the number is written as real text into each page it can be selected, searched and read by screen readers like the rest of the document.
Numbering runs as soon as you choose a PDF, using the defaults of bottom centre, the format 1, 2, 3, a first number of 1 and normal size, and runs again each time you change a setting, so you can compare positions on the first-page preview before downloading report-numbered.pdf. A checkbox leaves the first page unnumbered for a cover and a Pages box restricts numbering to part of the document.
Key features
- Six positions: bottom or top, centred, left or right, each half an inch from the page edge.
- Four formats: 1, 2, 3; Page 1; 1 of 12; Page 1 of 12, where the total is the number of pages numbered.
- Any first number from 0 to 9999, an optional unnumbered cover, and a Pages box to number only part of the document.
- Real Helvetica text in dark grey at 9, 11 or 14 pt, selectable and searchable, with no font file embedded.
- Correct placement and upright text on pages stored with a rotation, such as landscape scans.
How the numbers are placed
For each page that receives a number, the tool composes the label from the format, the running count and the first number, measures its width in Helvetica at the chosen size, and appends a text-drawing instruction to the page's content stream. The font is one of the fourteen standard PDF fonts, so no font file is embedded and the file grows only by a font dictionary and a short content stream per page; a 4,169-byte test document became 5,340 bytes.
Positions are measured in points from the edges of the visible page, the CropBox, which for most files is the whole sheet: the baseline of a bottom number sits 36 points (half an inch) above the bottom edge, a top number's baseline sits 36 points plus the font size below the top edge, left and right numbers start or end 36 points in from the side, and the centre positions use the measured text width to centre exactly. The total in 1 of 12 and Page 1 of 12 counts the pages that actually receive a number, so with a skipped cover a 13-page document reads Page 1 of 12 on its second page.
Pages stored with a /Rotate entry, common for landscape scans, are numbered in the frame a reader displays, with the text turned to read upright; the section below works through the coordinates.
How it works
The PDF is checked for its header and the 50MB limit and loaded with pdf-lib. The Pages box becomes an ascending list of page numbers, page 1 is dropped from it when the cover checkbox is ticked, and if nothing is left the run stops with No pages are left to number. Helvetica is registered on the document once, and the dark grey colour and the chosen size are fixed for the run.
Each target page is visited in order. Its label is built from the format, the first number plus its index in the list, and the list length as the total; its width comes from the font metrics; the page's visible box is computed from its CropBox and /Rotate entry; and the baseline point for the chosen position is translated into page coordinates and the text drawn there, turned to stay upright. The result is saved with object streams and offered as report-numbered.pdf, with the first page rendered for the preview.
Common use cases
- Numbering a court or tribunal bundle assembled with Merge PDF so every exhibit page can be cited by number at a hearing.
- Adding Page 1 of 24 to a lease or employment contract so a signatory can confirm no page is missing.
- Giving a thesis exported from several chapters a single running sequence, with the title page left unnumbered.
- Stamping a scanned ledger or minute book whose pages were never numbered so references in a report can point to them.
How to use this tool
- Choose Position and Format first if you already know them; the defaults are Bottom centre and 1, 2, 3, and settings made before the file is added are used on the first run.
- Add the PDF. It is numbered at once, and every later change to a setting renumbers it from the original, so nothing stacks.
- Set First number and Size, tick Leave the first page unnumbered (cover) for a title page, or type a selection in Pages such as 3-; press Enter in Pages to apply it without the pause.
- When the chip shows the expected count, N pages numbered, Download .pdf saves report-numbered.pdf.
Example
Source and settings
thesis.pdf — 13 pages (page 1 is the title page)
Position: Bottom centre
Format: Page 1 of 12
First number: 1
Leave the first page unnumbered (cover): ticked
Pages: allResult
thesis-numbered.pdf — 13 pages
Page 1: no number
Page 2: "Page 1 of 12" (Helvetica 11 pt, baseline 36 pt above the bottom edge)
Page 3: "Page 2 of 12"
…
Page 13: "Page 12 of 12"
Summary: 13 pages in · 13 pages out · 12 pages numberedTips for best results
- Leave the first page unnumbered (cover) and typing 2- in Pages give the same result on a plain document; the checkbox earns its place when Pages already holds a selection such as 1-10 that should still skip the cover.
- Set First number to continue a sequence: for the second volume of a bundle whose first volume ended at page 212, enter 213. Avoid the 'of' formats when doing this, because the total still counts only the pages in this file.
- Match the position to the document's margins. The number sits half an inch from the edge, so on a page with half-inch margins a bottom-centre number lands level with the last line of text; choose a corner or the top if that is too close.
- Use the Pages box to number only the body of a document, for example 3-, so a title page and contents page stay clean; the first number then applies to page 3.
Edge cases to watch
The total counts numbered pages, not the highest number. With First number set to 5 on a three-page file, the Page 1 of 12 format produces Page 5 of 3, Page 6 of 3 and Page 7 of 3.
Existing page numbers are not detected or removed. A document that already has footers ends up with two numbers, possibly overlapping if both sit at the bottom centre; choose a different corner.
The number is stamped in dark grey directly on whatever the page already shows. Over a dark footer band or a full-bleed photograph it can be hard to read, and there is no option to put a white box behind it.
Setting First number to 0 is allowed and produces Page 0 on the first numbered page, which is rarely what a reader expects.
Common errors and how to fix them
- No pages are left to number.
- The cover checkbox removed the only page in your selection, typically Pages set to 1 with the checkbox ticked. Untick the box or widen the selection.
- "p3" is not a page or a range. Use numbers like 1-3, 5, 8.
- Only digits, hyphens and commas are understood. Remove letters such as p or the word page, and put commas between entries.
- This PDF is password-protected. Open it with Unlock PDF first, then try again.
- Numbers are written into the page content, which cannot be done while the file is encrypted. Remove the password with Unlock PDF, then number the plain copy.
- This file is empty.
- The chosen file has zero bytes, usually a failed download or an interrupted save. Re-download or re-export the PDF and try again.
Best practices
- Number last, after merging, deleting and rotating, so the sequence and total match the final page order and orientation.
- Pick a position clear of existing footers and headers; bottom right or top right rarely collide with running titles.
- Keep the 'of' formats for documents that will not be split again, since the total is fixed at numbering time and becomes wrong when pages are removed later.
How the number lands on a rotated page
A landscape scan is often stored as a portrait page with a /Rotate value of 90, which tells the reader to turn it for display. Drawing at the bottom centre in raw coordinates would put the number along the displayed left edge, running sideways. The tool instead computes the visible box, swapping width and height for 90 and 270, places the number at the requested visible position and maps that point back into page coordinates: on a 612 by 792 point page turned 90 degrees, visible bottom centre becomes x = 576 and a y roughly halfway up the long edge, with the text turned 90 degrees so it reads upright.
This is why the order of operations matters when you also use Rotate PDF. If you rotate after numbering, the already-drawn number turns with the page and ends up on a side edge; if you rotate first, the numbering tool sees the final rotation and places the number where a reader looks for it. The same frame-aware placement is used by Watermark PDF, so both stamps stay consistent on a document that mixes portrait and landscape pages.
Frequently asked questions
Can I start numbering on the second page?
Yes. Tick Leave the first page unnumbered (cover). Page 2 receives the first number and the total in the 'of' formats counts only the numbered pages, so a 13-page file reads Page 1 of 12 on its second page.
Can I use Roman numerals or a different font?
No. The numbers are Arabic digits in Helvetica at 9, 11 or 14 points in dark grey; there are no numeral styles, fonts, colours or prefixes beyond the four formats offered.
Will the numbers be real text or an image?
Real text. Each number is a text-drawing instruction in the page's content stream using the standard Helvetica font, so it can be selected, searched and read aloud by assistive technology.