how to make page numbers on google docs

Easy Google Docs Page Numbers: How-To Guide

By Mark Martin
AD

Imagine you've written a long, comprehensive document on Google Docs, and you need to add page numbers to lend a professional touch and aid navigation. But how do you achieve this? Surprisingly, Google Docs doesn't support automatic page numbers like Microsoft Word, but don't worry, we've got you covered with a simple workaround.

In this guide, we'll delve into the process of adding page numbers in Google Docs, ensuring your document looks polished and easy to navigate. So, let's dive right in and explore the step-by-step process.

Understanding the Workaround

As mentioned, Google Docs doesn't directly support page numbers. However, you can leverage a trick that involves using bookmarks and a table to mimic the page number functionality. Let's break down this process into manageable steps.

AD
an open book with the title how to format google docs like a novel file page setup
an open book with the title how to format google docs like a novel file page setup
How to Add Page Numbers in Google Docs
How to Add Page Numbers in Google Docs
How to Change the Starting Page Number in Google Docs
How to Change the Starting Page Number in Google Docs

The process involves creating a bookmark that will serve as a placeholder for your page numbers. Then, you'll create a table with a single cell that will contain the page numbers. Finally, you'll create a script that updates the page number in the table cell as you navigate through your document.

Creating a Bookmark as a Page NumberPlaceholder

First, you need to create a bookmark that will serve as the starting point for your page numbers. This bookmark will be like a flag in your document that tells the script where to start numbering the pages.

Google docs hacks
Google docs hacks
How to Add Page Numbers in Google Docs and Google Sheets
How to Add Page Numbers in Google Docs and Google Sheets
a computer screen with the text how i format my docs for manuscript writing google docs
a computer screen with the text how i format my docs for manuscript writing google docs

Here's how to create a bookmark:

  1. Place your cursor where you want the page numbers to start (usually at the top of the first page).
  2. Click "Insert" in the menu, then select "Bookmark" from the dropdown.
  3. Give your bookmark a name, like "Page1," and click "Save."

Setting Up the Table for Page Numbers

Next, you'll create a table that will hold your page numbers. You'll place this table at the bottom of each page, and the script will update the page number in this table as you navigate through your document.

AD

Here's how to set up the table:

a computer keyboard with the words how to make a book on google documents written below
a computer keyboard with the words how to make a book on google documents written below
How to Add Line Numbers in Google Docs
How to Add Line Numbers in Google Docs
How to Add Page Numbers in Google Docs
How to Add Page Numbers in Google Docs
an image of how to format google docs like a novel file page setup 1 page size a4 2 all margins 0 for page numbers go
an image of how to format google docs like a novel file page setup 1 page size a4 2 all margins 0 for page numbers go
How to Start Page Numbers from Page 3 in Google Docs [A 2025 Guide] - Technical Wall
How to Start Page Numbers from Page 3 in Google Docs [A 2025 Guide] - Technical Wall
How to Make Lined Paper in Google Docs
How to Make Lined Paper in Google Docs
  1. Click "Insert" in the menu, then select "Table" and choose a 1x1 table.
  2. Resize the table cell so that it's small and unobtrusive. You can do this by clicking on the table, then clicking the "More" button in the toolbar that appears. Select "Table properties," then "Options," and adjust the cell size.
  3. Click inside the table cell, and type "1" (without quotes). This will be the starting page number.

Creating the Script to Update Page Numbers

Now that you've set up the bookmark and the table, it's time to create a script that will update the page number in the table cell as you navigate through your document.

Here's how to create the script:

AD
  1. Click "Tools" in the menu, then select "Script editor."
  2. Delete any existing code in the editor, then paste the following:
```javascript function onOpen() { DocumentApp.getUi().onExecuteMenuItem = onExecute; } function onExecute(e) { var numPages = DocumentApp.getActiveDocument().getNumPages(); var bookmark = DocumentApp.getActiveDocument().getBookmarks("Page1"); var setPageNumber = DocumentApp.getActiveDocument().getNamedRange("setPageNumber"); setPageNumber.setRange(DocumentApp.getActiveDocument().getBody().getElements()[document.getCurrentPage()-1].getAttributes().rolePage); } onOpen(); ```

This script sets up the page numbers whenever you open your document. It counts the number of pages in the document, gets the range of the bookmark you created earlier (which you've named "setPageNumber"), and sets the page number in the table cell based on the current page number.

How to Add Headers and Footers in Google Docs | Google Docs Tutorial
How to Add Headers and Footers in Google Docs | Google Docs Tutorial
How To Format Your book in Google docs.
How To Format Your book in Google docs.
how to have nice notes on google docs
how to have nice notes on google docs

Adding the Script to Your Document

Now, you need to add the script to your document so that it can update the page numbers as you navigate.

Here's how to add the script:

AD
  1. Click "Insert" in the menu, then select "Named range."
  2. Give the named range a title, like "setPageNumber," and click "Save."
  3. Click inside the table cell that contains the page number, then click "Insert" in the menu, and select "Named range."
  4. Select the "setPageNumber" you just created and click "Insert."

That's it! Your page numbers should now update automatically as you navigate through your document. If you make any changes to your document that affect the number of pages, you'll need to run the script again to update the page numbers.

Remember to bookmark this page or save the script so you can access it later if you close your Google Docs window. Also, be sure to run the script every time you open your document to ensure your page numbers are accurate.

Formatting Page Numbers

You can format the page numbers in the table cell by selecting the cell, then clicking the "More" button in the toolbar that appears. Select "Paragraph style," then click the "More options" button to access the formatting options.

That's all there is to it! Adding page numbers to Google Docs might seem like a complex process at first, but once you understand the workaround, it's quite straightforward. Now, go ahead and make your Google Docs documents even more professional with this useful trick.

Next time you're working on a long document and need to add page numbers, remember this guide. It might save you a lot of time and effort in the long run. Happy doc-making!

AD