Add page number X of Y to a document

If you need to show the current page number and the total number of pages in a document, you can use the Page Number Gallery, or you can insert field codes. If your document doesn't already have a header, you can use the Page Number gallery. If your document does have a header, you'll need to use Quick parts and field codes.

What do you want to do?

Insert Page X of Y with no existing header

Insert Page X of Y into an existing header

Learn more about page numbers

Insert Page X of Y with no existing header

The Page Number Gallery provides a menu of ready-to-use page numbers.

  1. On the Insert tab, click Page Number.

    To add page numbers, choose the Insert tab, and then select Page Number.
  2. Click a location, such as Top of Page.

    Note:  The Page Margins location does not include preformatted Page X of Y page numbers.

  3. In the gallery, scroll through the options until you see Page X of Y.

    In the gallery of page number styles, scroll to locate "Page X of Y" styles.
  4. Click a page number format.

  5. To return to the body of your document, click Close Header and Footer on the Design tab (under Header & Footer Tools), or double-click anywhere outside the header or footer area.

    The Close Header and Footer option is highlighted on the Header and Footer Tools tab.

Insert Page X of Y into an existing header

When you use the Page Number Gallery, Word automatically inserts two field codes for you—Page and NumPages. To add Page X of Y number formatting into an existing header without losing the text, you'll have add those codes manually by using Quick Parts.

  1. Double-click in the header area or the footer area (near the top of the page or near the bottom of the page).

    This opens the Design tab under Header & Footer Tools.

    Choose Close Header and Footer on the Design tab to stop editing the header or footer.

  2. Position your cursor where you’d like to add the page numbers.

    To place the page numbers in the center or on the right side of the page, do the following:

    • To place your page numbers in the center, click Insert Alignment Tab in the Position group of the Design tab, click Center, and then click OK.

    • To place your page numbers on the right side of the page, click Insert Alignment Tab in the Position group of the Design tab, click Right, and then click OK.

  3. Type page and a space.

  4. On the Insert tab, click Quick Parts, and then click Field.

    Inserting a field using Quick Parts

  5. In the Field names list, click Page, and then click OK.

  6. After the page number, type a space, type of, and then type another space.

  7. Again, on the Insert tab, click Quick Parts, and then click Field.

  8. In the Field names list, click NumPages, and then click OK.

  9. After the total number of pages, type a space, and then type pages.

  10. To change the numbering format, click Page Number in the Header & Footer group, and then click Format Page Numbers.

  11. To return to the body of your document, click Close Header and Footer on the Design tab (under Header & Footer Tools).

    The Close Header and Footer option is highlighted on the Header and Footer Tools tab.

If you’d like to learn more about field codes, see Field codes in Word.

  • To show the total number of pages as well as the page number (for example, page 3 of 10), check the Include Page Count box near the top of the gallery.

    Image of the check box to select to include the page count with the page numbers in a doc (page X of Y).

  • If you don’t want page numbers after all, click Remove Page Numbers at the bottom of the gallery.

  • To show the document title, author’s name, or some other text with the page number, or to hide the page number on the title page, start by using Insert > Header & Footer instead of Insert > Page Numbers. For more info, see Add page numbers to headers or footers.

  • For more options—if, for example you want different page numbering in different sections—edit the document in Word instead of editing it in Word Online. If you don’t have Word, you can try or buy it now.

Learn more about page numbers

Expand your skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×