How to Add Page Numbers To a PDF

In the world of digital documents, adding page numbers to a PDF can help organize your content and improve navigation, whether it's for a research paper, a business proposal, or any other type of document. Fortunately, you don't need expensive software to accomplish this task as there are many free PDF tools available. In Adobe Acrobat Pro DC, edit PDF toolbar allows you to add page numbers but it only provides a 7 day free trial.

In this article, we will guide you through the process of adding page numbers to a PDF for free using three methods: Sejda, Smallpdf, and IronPDF for more edit PDF options.

Sejda - Online PDF Tool

Sejda Online PDF Tool offers a straightforward method to add page numbers to your PDF documents.

Add Page Numbers to a PDF Using Sejda Online PDF Tool

Follow these steps to add page numbers without any hassle:

Step 1 Visit the Sejda Online PDF Tool Website

Open your web browser and visit the Sejda Online PDF Tool website.

How to Add Page Numbers To a PDF: Figure 1

Then search for "Page Numbers" in "All Tools" menu bar.

How to Add Page Numbers To a PDF: Figure 2

Step 2 Upload Your PDF

Click on the "Upload PDF files" button to upload the PDF files you want to add page numbers to.

How to Add Page Numbers To a PDF: Figure 3

Step 3 Add Page Numbers

After uploading the file, it provides you with the "Add PDF Page Numbers" web page. Here, you can customize the appearance and location of the page number, including the font style, font size, position, document margins and page number format. By clicking more options, you can add page numbers to specific pages and page range.

How to Add Page Numbers To a PDF: Figure 4

Step 4 Add Headers and footers

Once you've configured your page numbering preferences, click the "Add Header/Footer" button. Sejda will process the file and add page number to PDF pages.

How to Add Page Numbers To a PDF: Figure 5

Step 5 Download the PDF

After the page numbers have been added, click the "Download" button to save the PDF file with page numbers to your computer. The file have has numbers at the top in header text.

How to Add Page Numbers To a PDF: Figure 6

Now you have successfully added page numbers to your PDF using Sejda Online PDF Tool.

Smallpdf

Smallpdf, a versatile online PDF editing tool, provides an easy way to add page numbers to your PDF files.

Add Page Numbers to a PDF Using Smallpdf

Here's how to do add page number to entire document:

Step 1 Go to the Smallpdf Website

Open your web browser and visit the Smallpdf website at.

How to Add Page Numbers To a PDF: Figure 7 - Image displaying the Smallpdf website.

Step 2 Access the "Number Pages" Tool

On the Smallpdf homepage, find the "Number Pages" tool, and from the dropdown menu, click on it or navigate to <www.smallpdf.com/add-page-numbers-to-pdf>.

How to Add Page Numbers To a PDF: Figure 8 - To access the Number pages tool on the Smallpdf website, navigate to the Tools drop down menu and click on the Number Pages option.

Step 3 Upload Your PDF

Click the "Choose file" button to upload the PDF document to the box to which you want to add page numbers.

How to Add Page Numbers To a PDF: Figure 9 - After clicking on the Number Pages tool menu, you will be redirected to the Add & Insert Page Numbers to PDF webpage. Upload the PDF document to which you want to add page numbers.

Step 4 Customize Page Numbers

In the tool, you can only customize the location of the page numbers. You can choose the position on the page, other than that Smallpdf does not provide any features like number format, page range options, header and footer.

How to Add Page Numbers To a PDF: Figure 10 - Smallpdf only allows you to customize the position of the page numbers, other PDF customizations like number format, page range options, header and footer are not available using the Smallpdf.

Step 5 Add Page Numbers

After customizing your preferences, click the "Number Pages" button. Smallpdf will process the file and add page numbers to each page.

How to Add Page Numbers To a PDF: Figure 11

Step 6 Download the PDF

Once the page numbers have been added, click the "Download" button to save the PDF file with page numbers to your computer. Now open your downloaded PDF to view all the pages with added page numbers.

How to Add Page Numbers To a PDF: Figure 12

Introducing IronPDF

While Sejda Online PDF Tool and Smallpdf are excellent options for adding page numbers to PDF files, they may not provide the advanced features that some users require. If you need a more powerful and flexible solution, you might consider IronPDF.

IronPDF is a robust PDF editing tool that offers a wide range of features, including the ability to easily add page numbers to PDF documents. It can be used both as a standalone desktop application and integrated into your web application using the IronPDF API. Additionally, IronPDF is compatible with both Windows and Mac operating systems.

IronPDF provides advanced capabilities for adding page numbers with specific formatting to various sections of your PDF documents. You can effortlessly insert page numbers on odd pages and even pages, customize date formats, include page numbers on the first page or specific sections, and even add bates number for document tracking and organization. This versatility empowers you to tailor your PDFs with precision, whether for professional reports, legal documents, or any scenario requiring specialized page numbering and document management.

How to Add Page Numbers to a PDF Using IronPDF

To add page numbers to a PDF using IronPDF, follow these steps:

Step 1 Install IronPDF

Download and install the IronPDF from the IronPDF website, or you can download and install using NuGet Package Manager in Visual Studio with the following command:

Install-Package IronPdf

Step 2 Import IronPdf and Create an HTML String

First import the IronPdf package and then create an HTML string to be converted to PDF with page numbers.

using IronPdf;

var html = @"
    <p> Hello Iron</p>
    <p> This is 1st Page </p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 2nd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 3rd Page</p>";
using IronPdf;

var html = @"
    <p> Hello Iron</p>
    <p> This is 1st Page </p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 2nd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 3rd Page</p>";
Imports IronPdf

Private html = "
    <p> Hello Iron</p>
    <p> This is 1st Page </p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 2nd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 3rd Page</p>"
VB   C#

Step 3 Instantiate ChromePdfRenderOptions and Customize Page Number Format

In the following code example, first we initialize a PDF renderer (ChromePdfRenderer) with specific HTML footer settings. It defines the content, styling, and layout of the footer that will be added to each page of the PDF when it is generated using HTML Header Footer class.

// Instantiate Renderer
var renderer = new ChromePdfRenderer
{
    RenderingOptions =
    {
        HtmlFooter = new HtmlHeaderFooter()
        {

            MaxHeight = 15, // millimeters
            HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
            DrawDividerLine = true
        }
    }
};
// Instantiate Renderer
var renderer = new ChromePdfRenderer
{
    RenderingOptions =
    {
        HtmlFooter = new HtmlHeaderFooter()
        {

            MaxHeight = 15, // millimeters
            HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
            DrawDividerLine = true
        }
    }
};
' Instantiate Renderer
Dim renderer = New ChromePdfRenderer With {
	.RenderingOptions = {
		HtmlFooter = New HtmlHeaderFooter() With {
			.MaxHeight = 15,
			.HtmlFragment = "<center><i>{page} of {total-pages}<i></center>",
			.DrawDividerLine = True
		}
	}
}
VB   C#

Step 4 Render HTML as PDF Document

Once you've configured your page numbering preferences, call the RenderHtmlAsPdf method to convert it to PDF. IronPDF will apply the page numbers to each page of the PDF.

var pdf = renderer.RenderHtmlAsPdf(html);
var pdf = renderer.RenderHtmlAsPdf(html);
Dim pdf = renderer.RenderHtmlAsPdf(html)
VB   C#

Step 5 Save the PDF

After adding the page numbers, save the PDF document with the page numbers included.

pdf.SaveAs("pageNumber.pdf");
pdf.SaveAs("pageNumber.pdf");
pdf.SaveAs("pageNumber.pdf")
VB   C#

Here is the output:

How to Add Page Numbers To a PDF: Figure 13

Conclusion

Adding page numbers to a PDF document is a simple yet effective way to enhance its readability and organization. Whether you choose to use Sejda Online PDF Tool for its user-friendly interface, Smallpdf for a straightforward online solution, or IronPDF for advanced features and flexibility, you can achieve your goal of adding page numbers to your PDF files without incurring any cost.

IronPDF simplifies the task of adding page numbers and custom headers/footers to PDFs with precision and flexibility. You can easily customize the appearance and placement of headers and footers, including dynamic page numbers that update automatically. Whether you need watermarks, various content formats, or handling different page sizes, IronPDF streamlines the process while seamlessly integrating into your applications, making it the go-to choice for enhancing PDF documents.

If you want to use IronPDF in your project, you can get a commercial license starting at $749 for a single developer. IronPDF also offers a free trial with full features and support, so you can test it out before buying. If you decide to purchase a commercial license, there are different options available, including ones for multiple developers and larger enterprises. You can download the software from here.