Processed on-device · pdf.js + pdf-lib

Add Page Numbers to PDF — position, format, and type you choose

Add page numbers to a PDF directly in your browser. Choose the position, page range, numbering style, font, color, and text pattern, then preview the result before downloading.

See how it works
Six position options Font, size & color Page range & skip cover Live preview Your PDF stays in your browser
Built & maintained by Bhavin J. Sheth | Updated

Add page numbers to your PDF

Upload a PDF, choose your numbering settings, preview the result, and download the finished file.

Drop your PDF here

or browse files

What this tool actually does

A folio is a small detail — getting it wrong is obvious

Anyone can drop "Page 1" in a corner. The work is in making it sit where it belongs, count what it should count, and read like it was set by the same hand as the rest of the document.

A text layer, drawn precisely

A thesis needs the cover unnumbered and the body starting at 1. A contract needs every page numbered so a citation like "see page 12" is unambiguous. A photo book might want small italic numerals in a corner instead of a bold footer.

This tool draws a text layer onto each selected page using pdf-lib, without touching anything already on that page. You set the position, the range of pages to number, the numeral style, and the exact typography, and see the result on every page before the file is rebuilt.

What you're actually setting

Position and margin

Six corner/edge combinations, plus a margin of small, medium, big, or an exact point value you type in.

Which pages count

Number everything, a custom range like "2-5, 8", or skip the first page so the sequence starts where the content does.

Numeral style

1-2-3 for most documents; a-b-c or A-B-C for front matter and appendices that follow that convention instead.

Typography

Helvetica, Times, or Courier, in three sizes, any color, with bold or italic and adjustable opacity.

The text pattern itself

A bare number, "Page 1", "Page 1 of 20", or a custom string built from the n and N placeholders.

Four steps, in the order that avoids redos

Set position and range before you touch typography — it's faster to check placement once than to re-check it after every font change.

1

Upload your PDF

Drag your file onto the upload area, or click Select PDF. It's read once, in your browser — nothing is sent anywhere.

A preview of every page appears below the settings panel.
2

Dial in the settings

Every change re-renders the previews instantly:

Pick a position (like bottom-center) and a margin.
Set a custom range or tick Skip first page for covers.
Choose format, font, size, color, and a pattern like "Page 1 of 10".
3

Add the numbers

Once the preview looks right, click Add Page Numbers. pdf-lib adds the numbers to a new PDF using the settings you selected.

Processing runs in this tab, start to finish.
4

Check, rename, download

Page through the numbered file, rename it if you like, then download it.

Page-by-page preview Rename before download

From unnumbered draft to a document you can cite

The cover stays clean; the content pages count from 1.

Before No numbers
PDF pages before adding page numbers - no numbers

No way to say "see page 3" and have it mean anything.

Numbered
After — Page n of N Citable
PDF pages after adding page numbers - correct sequence and layout

Cover skipped, sequence starts at 1 on the first real page.

Where a missing page number actually causes a problem

Cases where someone downstream needs to reference an exact page — not just read the document top to bottom.

SituationWhat mattersTypical user
Thesis submissionNumbering that follows the university's format, with the cover and title page excluded.Graduate students
Contract reviewEvery clause page numbered so "see page 12" points to something real.Lawyers & paralegals
Financial reporting"Page X of Y" footers on statements and audits so reviewers can track completeness.Accountants & finance teams
Client proposalsNumbered sections so a client can jump to pricing or scope on a call.Sales teams & consultants
Technical manualsPage references that make an index or troubleshooting table actually usable.Technical writers
Self-published booksChapter pagination readers can bookmark and return to.Authors & publishers
Board and meeting packsNumbered agenda bundles so a discussion can reference an exact page live.Company secretaries
Family archivesNumbered scanned pages so a recipe or record stays easy to look up later.Families & hobbyists
Numbering syntax

What each format and pattern does

Exactly how the format dropdown and pattern placeholders translate into the text printed on the page.

Numeric and alphabetical

1, 2, 3 is the default sequence. a, b, c and A, B, C exist for front matter, appendices, or legal exhibits that conventionally skip numeric pagination.

The n and N placeholders

In any pattern, n is the current page's position in the numbered sequence, and N is the total count — "Page n of N" becomes "Page 3 of 20".

Custom ranges and skip-first

A range like 2-5, 8 numbers only those pages, and the count restarts at 1 on the first page in that set. Skip first page is a shortcut for leaving page 1 out of it.

A bad range is skipped, not rejected

A reversed range like 10-5, or a page past the document's length, is silently ignored — the valid parts of the range still get numbered.

When a number lands somewhere wrong

Identify the problem, then use the matching fix.

Symptom
Why it happens
Fix

Number overlaps existing footer text

It's landing where the document already has its own footer or header content.

Choose the opposite edge (top instead of bottom), or increase the margin until it clears.

Some pages have no number

A custom range or "Skip first page" excluded those pages on purpose.

Check the range field and the skip checkbox, or switch back to All pages.

Numbering doesn't match physical page position

The sequence counts only the pages you selected — skipping the cover makes physical page 2 show "1".

That's expected. Use a custom pattern if you need the physical page value shown instead.

Number sits too close to the trim edge

The margin is set to Small or a low custom value.

Increase the margin until the number clears the existing content; 36 points is a useful starting point for many layouts.

Position shifts on some pages

The file mixes page sizes or rotated pages, so a fixed margin lands differently on each.

Fix size and orientation first with Organize PDF, then number.

Font doesn't match the document

Only three standard PDF fonts — Helvetica, Times, Courier — can be embedded this way.

Pick the closest family and adjust size and color so it sits well with your layout.

Numbers look faded

The opacity is set below 100%, or the selected color is too light.

Set opacity to 100% and choose a darker color for better readability, especially when printing.

Previews update slowly on a big PDF

Every setting change re-renders every page canvas, which uses browser memory.

Normal for large files — make changes gradually, or test settings on a short copy first.

Number overlaps existing footer text

Why: It lands on existing footer content.

Fix: Choose the opposite edge or increase margin.

Some pages have no number

Why: A range or skip-first excluded them.

Fix: Check the range field or switch to All pages.

Numbering doesn't match physical page position

Why: The sequence counts only selected pages.

Fix: Expected — use a custom pattern for physical values.

Number sits too close to the trim edge

Why: Margin is too small.

Fix: Use Medium/Big or a custom margin ≥ 36.

Position shifts on some pages

Why: Mixed page sizes or rotations.

Fix: Fix pages with Organize PDF first.

Font doesn't match the document

Why: Only 3 standard PDF fonts are embeddable.

Fix: Pick the closest family and tune size/color.

Numbers look faded

Why: Opacity below 1 or a light color.

Fix: Set opacity to 1 and a darker color.

Previews update slowly on a big PDF

Why: Every change re-renders every canvas.

Fix: Change settings in small steps.

Clean pagination on the first attempt

A working order that avoids the most common redo.

Finalize page order first

Merge and organize your pages before numbering — numbers are stamped onto the current order, so reordering afterward makes them wrong.

Skip covers and title pages

Use Skip first page or a custom range when your document's submission guidelines exclude the cover or title page.

Use "Page n of N" for long documents

Readers navigate faster when a footer shows both the current position and the total count.

Match the body typography

A number set in the same family and a sensible size as the body text reads as intentional, not stamped on afterward.

Check the first and last page in the preview

Scroll to both extremes of the document to confirm the margin clears any existing headers or footers everywhere.

Keep full opacity for print

A transparent number can look fine on screen but print faintly — use full opacity and a dark color for anything print-bound.

Questions people actually ask

If something's not covered here, the troubleshooting section above likely has it.

Does this tool upload my PDF anywhere?

No. Rendering and numbering both run in your browser using pdf.js and pdf-lib, so the file is never sent to a server.

Can I number just a few pages?

Yes. Switch to Custom range and type something like 3-12, 15 to number only those pages.

Does adding numbers change the rest of the PDF?

The tool adds the page numbers as new text on the selected pages. Your existing page content is not intentionally replaced or removed.

Can I leave the cover page unnumbered?

Yes. Tick Skip first page, or set a custom range starting from page 2, so the cover stays clean while the rest numbers in sequence.

What do n and N mean in a text pattern?

n is replaced by the page's position in the numbered sequence, and N by the total count of numbered pages — so "Page n of N" renders as "Page 3 of 20".

Can I change the font, size, or color?

Yes. Pick Helvetica, Times, or Courier, a small/medium/large size, any color, and bold or italic — the preview updates as you adjust each setting.

Is this free?

Yes, with no account or payment required.

Build notes

The write-up on how this was built

Because positioning, range parsing, and typography all run client-side, I wrote up the implementation — coordinate math for each corner, embedding standard PDF fonts, and re-rendering the previews on every setting change.

Build guide on freeCodeCamp

How to Build a PDF Page Numbering Tool Using JavaScript

Covers browser-based PDF editing, positioning math, typography settings, and client-side document processing without a server round-trip.

Read the write-up on freeCodeCamp

Written by Bhavin Sheth · Founder, AllInOneTools