Learn more about OnlyDocs PDF Editor and our Business API.

OnlyDocs Blog

How to Add Page Numbers to a PDF

Cover Image for How to Add Page Numbers to a PDF
OnlyDocs Team
OnlyDocs Team

You've finished your PDF. It's polished, professional, and ready to send — except it doesn't have page numbers. And now the person reviewing it is going to say "can you look at the section on page... uh... somewhere in the middle?"

Page numbers seem like such a basic thing. Word processors add them automatically. But PDFs? Once a document is in PDF format, adding page numbers after the fact can feel weirdly complicated. Most tools either want you to pay $20/month for the privilege or require downloading sketchy desktop software.

Let's fix that. Here's how to add page numbers to any PDF — free, fast, and without installing anything.

Why Page Numbers Matter More Than You Think

Before we get into the how, let's talk about the why. Page numbers aren't just a formatting nicety. They serve real purposes:

Navigation. When someone says "see page 12," everyone can find it immediately. Without page numbers, you're stuck with "scroll down past the chart with the blue bars."

Legal and academic requirements. Court filings, academic papers, contracts, and government forms often require numbered pages. Submit without them and you might get your document rejected.

Print reliability. If someone prints your 40-page PDF and drops the stack on the floor, page numbers are the only thing saving them from a very bad afternoon.

Professional appearance. Unnumbered pages look unfinished. It's subtle, but people notice — especially clients and reviewers.

Method 1: Add Page Numbers Online (Free)

The fastest way to add page numbers to a PDF is with an online tool. No downloads, no accounts, no learning curve.

Using OnlyDocs

  1. Go to onlydocs.net
  2. Upload your PDF
  3. Use the text tool to add page numbers, or use the annotation features to place numbers exactly where you need them
  4. Export your finished PDF

The advantage of using an online editor like OnlyDocs is flexibility — you can position numbers wherever you want, choose your font and size, and skip certain pages (like the cover page) if needed.

What to look for in an online tool

Not all online PDF tools handle page numbers the same way. Here's what matters:

  • Position options — Can you put numbers at the top, bottom, left, right, or center? Some tools only offer one position.
  • Starting page — Can you skip the first page? Most formal documents don't number the cover or title page.
  • Custom starting number — If your PDF is chapter 3 of a larger document, you might need to start at page 47, not page 1.
  • Font and size control — You want the numbers to match your document's style, not stick out like they were added as an afterthought.

Method 2: Using Preview on Mac

If you're on a Mac, Preview is already installed and can handle basic PDF editing. But here's the honest truth: Preview doesn't have a built-in "add page numbers" feature.

What you can do is:

  1. Open your PDF in Preview
  2. Use Tools → Annotate → Text to add a text box on each page
  3. Type the page number manually
  4. Position and style the text box

This works for short documents (5-10 pages), but it's tedious for anything longer. You're manually adding a text box to every single page. For a 50-page document, this is a nightmare.

Better option: Use an online tool for bulk page numbering, then use Preview for any final touch-ups.

Method 3: Using LibreOffice (Free Desktop App)

LibreOffice is the best free desktop option for adding page numbers to a PDF. Here's the workflow:

  1. Open the PDF in LibreOffice Draw (not Writer — Draw handles PDFs better)
  2. Go to Insert → Header and Footer
  3. Configure your page numbers — position, starting number, format
  4. Export back to PDF via File → Export as PDF

Pros and cons of LibreOffice

Pros:

  • Completely free and open source
  • Works offline
  • Handles large documents well
  • Gives you full formatting control

Cons:

  • You need to download and install it (~300MB)
  • PDF rendering can sometimes shift elements slightly
  • The interface takes some getting used to

LibreOffice is a solid choice if you regularly work with PDFs and want a desktop tool that costs nothing. For one-off jobs, an online tool is faster.

Method 4: Using the Command Line (Power Users)

If you're comfortable with the terminal, there are free command-line tools that add page numbers to PDFs in seconds. This is especially useful if you need to process many files at once.

Using cpdf (free for personal use)

cpdf -add-text "%Page of %Pages" -bottom 30 -font "Helvetica" -font-size 10 input.pdf -o output.pdf

This adds "1 of 15" style numbering centered at the bottom of every page. You can customize the format:

  • %Page — current page number
  • %Pages — total page count
  • -top, -bottom, -left, -right — positioning
  • -range 2-end — skip the first page

Using pdftk + enscript

# Generate page number overlay
enscript -B -L1 --header='||Page $%' -o - < /dev/null | ps2pdf - numbers.pdf
# Stamp it onto your PDF
pdftk input.pdf multistamp numbers.pdf output output.pdf

This is a bit more involved but gives you precise control over formatting.

Common Page Numbering Formats

Not sure which format to use? Here are the most common styles and when to use them:

Format Example Best for
Simple number 1, 2, 3 Most documents
Page X of Y Page 1 of 15 Reports, proposals
Roman numerals i, ii, iii Preface/introduction sections
Section-page 3-1, 3-2 Technical manuals
Dash format - 1 -, - 2 - Academic papers

Tip: For formal documents, use "Page X of Y" format. It tells the reader both where they are and how much is left. For casual documents, simple numbers are fine.

How to Skip the First Page

Almost every formal document skips the page number on the cover page. Here's how to handle this with different tools:

Online tools: Look for a "start from page 2" or "skip first page" option. Most good tools have this.

LibreOffice: In the Header/Footer dialog, check "Same content on first page" and leave the first page blank, or set the first page to a different page style without headers.

Command line (cpdf): Add -range 2-end to only number from the second page onward.

Manual method: If you're adding numbers by hand, just... don't add one to the first page. Simple.

What About Headers and Footers?

Page numbers are often part of a larger header or footer that includes other information — the document title, author name, date, or section name.

If you need a full header/footer (not just page numbers), your best options are:

  1. Add them before converting to PDF — If the source document is in Word, Google Docs, or similar, add headers and footers there. It's always easier to do this before the PDF stage.
  2. Use LibreOffice — It has full header/footer support with auto-fields for page numbers, dates, and titles.
  3. Use an online PDF editor — Tools like OnlyDocs let you add text anywhere on the page, so you can build custom headers and footers with whatever information you need.

Troubleshooting Common Issues

Numbers are overlapping content: Your margins are too small. Either reduce the font size of the page numbers or adjust their position to sit further from the page edge.

Numbers look blurry when printed: Make sure you're using a vector-based text tool, not a raster stamp. Vector text scales cleanly at any print resolution.

Page numbers are wrong after merging PDFs: If you merged multiple PDFs and the page numbers from the original documents are still showing, you'll need to either remove the old numbers first or place new numbers on top with a larger, opaque background.

Font doesn't match the document: Use a neutral font like Helvetica, Arial, or Times New Roman for page numbers. They're meant to be functional, not decorative.


Add Page Numbers in 30 Seconds

If you just need to get this done quickly, here's the shortest path:

  1. Open OnlyDocs.net
  2. Upload your PDF
  3. Add your page numbers
  4. Export and download

No account required for basic edits. No watermarks. No "upgrade to unlock page numbers" nonsense.

Your document deserves to be navigable. Page numbers are a small detail that makes a big difference — especially when someone actually needs to use your PDF, not just glance at it.

✏️ Try OnlyDocs Free — Edit, sign, and merge PDFs right in your browser. No signup required.

Open Editor →