Getting a Proper Total Page Count

by Allen Wyatt
(last updated May 7, 2019)


Melissa has a document that begins with a title page. She wants the pages numbered beginning with 1, but that is actually the second page of the document. (The title page isn't counted in the page count.) She got the page numbering to start correctly for her first page, but her footer now says, "Page 1 of 80," "Page 2 of 80," etc. It should only show 79 pages, again because of the title page. Melissa wonders how she can get the total page count, as shown in the footer, to be correct.

The type of page numbers that Melissa is working with are generally called "X of Y" page numbers. The X represents the current page numbers, while Y represents the total. You generally construct this type of page number in one of two ways. First, you can create your own page numbers in this way by using field codes. Assuming you already know how to add field codes to your document, the finished code would look something like this:

Page { PAGE } of { NUMPAGES }

Once collapsed, the first field code displays the current page number and the second displays the total number of pages in the document. This brings us to the second way to insert the "X of Y" page numbers—using the pre-defined page number formats in Word.

You insert these by using the Page Number tool, which can appear on various ribbon tabs. (Most notably it appears on the Insert tab of the ribbon, in the Header & Footer group, and if you are working within a header or footer, on the Design tab of the ribbon, in the Header & Footer group.) The choices presented by the Page Number tool include a Page X of Y group that provides different ways to insert the formatted page number. When you make one of these choices, the result is a field similar to the following:

Page { PAGE \* Arabic \* MERGEFORMAT } of { NUMPAGES \* Arabic \* MERGEFORMAT }

This field code looks much longer than the handcrafted one presented earlier, but it is essentially the same; it just has a few switches added for each of the field codes.

Melissa's page layout most likely includes a section break between the title page and the first real page of the document. This assumption seems appropriate since Melissa indicated that she was able to basically suppress (hide) the page numbers on the title page and have the first real page start with page 1. The problem is that the field codes use the NUMPAGES field to get the desired "X of Y" type of page numbers. If your document has only two sections in it (one for the title page and the other for the rest of the document) you can simply change the NUMPAGES field to the SECTIONPAGES field. This field returns the total number of pages in the section (the main body of the document) instead of the total page count for the document. Your field code would, essentially, look like this:


You can make the change by simply positioning the insertion pointer in the footer, next to the page numbers, and pressing Alt+F9. This displays all the field codes in the document instead of the field code results. Just make the change to the second field, replacing the letters "NUM" with "SECTION". Press Alt+F9 again, and your page numbering should be correct, showing Page 1 of 79.

This approach will not work, however, if you have more than the single section break in your document. In that case you'll need to simply make a bit more complex change to the field codes used for the page number. Follow these steps:

  1. Position the insertion point just before the Y page number. At this point the field is probably highlighted automatically by Word.
  2. Delete the Y page number field.
  3. Press Ctrl+F9. Word inserts an empty set of field code braces.
  4. Type an equal sign and a space.
  5. Press Ctrl+F9 again. Word inserts another empty set of field code braces.
  6. Type NUMPAGES and a space.
  7. Position the insertion point just between the final two right braces.
  8. Type a minus sign and a 1. Your field code for the Y page number should now look very similar to this:
  9. { = { NUMPAGES } - 1 }
  10. Press Shift+F9 to collapse the fields.

This approach works because you are subtracting 1 (the length of the title page) from the total number of pages in the document. Thus, you end up with Page 1 of 79.

The two approaches discussed so far work great if you are going to be modifying the document and know that the length of your main body will change over time. If this assumption is not correct—if your document is static and it will never have less or more than 79 pages—then you can skip messing with the field code and simply type a static page count for the Y page number. (Just make sure you delete the field code for the Y page number first.)

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (5882) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Workaround for Multiple Rows of Worksheet Tabs

If you've got a lot of worksheets in your workbook, you may want to display their tabs in to rows at the bottom of the ...

Discover More

Adding a Toolbar to the Taskbar

Normally the taskbar is used to display icons for currently running programs on your system. Here's how you can go beyond ...

Discover More

Hyperlinks from Headings to the TOC

A table of contents is a great way to help organize lengthy documents. In a default TOC, you can use each entry as a ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Using Chapter Numbers with Page Numbers

Do you need to add page numbers that include, as well, a chapter number? It's relatively easy to do, as described in this ...

Discover More

Understanding Page Sizes

When you create a document, you need to be concerned about the final size of the page you will be creating. Word supports ...

Discover More

Odd Page Numbers Disappearing

Page numbers in printed pages are often a necessary part of formatting a document. What do you do if your printed output ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 9 - 8?

2019-06-15 01:27:13


Brilliant! A shame that something so common should be so difficult, but very well explained thank you.

2019-05-27 05:43:40

Younas Khan

In my document there are 7 sections, I want to have page numbers from section 1 to section 4 and then start from 5 to 7.
Section 1 pages = 10
Section 2 pages = 20
Section 3 pages = 25
Section 4 pages = 35
Section 5 pages= 10
Section 6 pages = 10
Section 7 pages = 10
From section 1 to section 4 total number of pages are 80. On page 1 of section 1 I want to see page number as (Page 1 of 80)
From section 5 to section 7 total number of pages are 30. On page 1 of section 5 I want to see page number as (page 1 of 30)

2019-04-28 22:20:31

Jay Kay

How do you apply the x of y renumbering to all page numbers without having to apply the function to each page?

2018-11-07 13:12:17


Excelente artigo!!
Resolveu o meu problema
Muito obrigado!
I'm from Brazil
Thank You!

2018-09-26 19:47:56


Your explanations are so clear, and so concise, and with just the right amount of dialog to understand the hidden nuances! Perfect for those like me who need hand-holding to execute the next step precisely and see the expected voila-outcome! Thank You Allen Wyatt! Steve.

2018-07-17 23:58:55

Stephen Jeffrey Watson

Thank you!

2017-12-06 14:02:13


Hi. You might consider amending this to include the scenario if you don't know how many pages are in the first part you don't want to count, and that there may be additional sections in the document. Here's what I did, for what it's worth, using your input as a starting point:

a) create a bookmark Bookmark1 on the last page of the pages numbered i, ii, iii.
b) insert section break to change footer where arabic numbering starts
c) starting in the new section, add field that subtracts from NUMPAGES the page number of the bookmark, converting first to arabic:
{ = { NUMPAGES} - {PAGEREF Bookmark1 \* arabic} }

2017-10-14 01:31:44

Brian A.

Thank you, thank you, thank you! :)

2017-05-04 23:21:54

Richard Hutchins

This was very helpful - I was trying to use the total number of pages in my footer; however, I did not want to include the pages in the index at the end of the document.
Apparently, I can use it total number of pages field and modify it to exclude the index.
Thank you.

2017-03-15 11:50:00

Maria P

This help was much better than Word's built in help. Word didn't even understand what I wanted to do, so couldn't answer my question. Thank you!!

2017-02-23 01:14:11


Thanks for this one - saved my bacon when time was very short!
(I'm already on your mailing list)

2017-02-17 10:07:14


I solved my issue. I shouldn't have changed the X page number using the formula.

Word (2013) makes it easy to change the X page. Put your cursor in the footer to activate the Header & Footer Tools tab. Click the Page Number dropdown and select Format Page Numbers. Then under "Page numbering" check "Start at" and select the value of the page number you want to start at (this controls the X page number).

After doing this, updating the TOC field reflected the correct page number for each section title listed in the TOC. I still had to use the formula with a "-6" to give the total page count that I wanted.

Thanks again for the all info.

2017-02-17 09:36:13


Thank you so much for this information. I have 6 pages of front matter to exclude from the page count. I used your information to reduce both X and Y page numbers.

However, my table of contents is not updating to the new page numbers. The TOC section titles correspond to the actual physical pages in the whole document, ignoring the formula in the page number field. Any suggestions on how to resolve this? Updating the field (page numbers only or entire field) doesn't work.

2017-01-18 13:33:35


Trevor, as long as all your appendices are in ONE section (i.e., no section breaks) you can use something like this:


Remember to reset page numbering to 1 at the start of your appendices.

If you have section breaks, you'll have to use creative workarounds like those described in the first two comments on this site.

2017-01-17 22:48:37


Hi Allen

Your description is very straight forward to the point. EXCELLENT.

I have another query and I am sure you may have written it else where. In the WORD document after main text, if I have Appendices, how do I number those X of Y pattern where Y should pick up the total number of Pages in the Appendices Section.

Kind Regards

2016-12-21 09:49:05


A tip that might be helpful: Shift+F9 only expands the field you're currently editing if it's selected or if your cursor is in it. An improperly formatted field might disappear completely from the screen, so you can select an area that includes your field and press Shift+F9 to expand it, or use ALT+F9 to expand all fields in the doc.

For anyone who missed it, if you have appendices or an end section that you don't want included in your page count, read Richard's and Sharon's comments all the way at the beginning on how to use bookmarks for this - GENIUS!

2016-11-15 12:50:26

Chris Pulaski

Thank you very much for this very helpful article.

2016-10-21 21:15:49


I was trying to do this programatically. I inserted an index too in a different section. Index consists of 6 pages. But {SECTIONPAGES} returns 1 . Index was inserted using insert -> quick parts -> field.

Any idea?

2016-09-07 23:15:11


i dont get it it wont work on me

2016-08-30 07:57:56


My degree, Civil engineering. My profession for many years, relational databases. I mention that only as relevance to my comment.

Microsoft's Engineers have created highly competent word processing software that is, IMHO, quite often and in many ways too complex for non-technically oriented users -- and that includes me.

I'd like to see it work more like any "point-and-shoot" calculation. Not a complaint. Just an observation.

2016-08-29 11:04:40


Thank you very much!

2016-07-20 13:19:33


I have a report with multiple sections throughout and an appendix at the end. I do not want the appendix to be in the total page count however using SectionPages is not an option because I have section breaks through out the document. I am creating a template for my office reports. Is there a way to only omit the last section and include all the previous sections?


2016-07-15 12:03:08


This is exactly what I was looking for. I was able to remove my title page and table of contents from the total page count. Thanks so much!

2016-06-30 14:07:02

Donna Jones

Thank you!!!!

2016-06-21 23:08:18


I forgot to mention that if the numbering can continue from previous, the page math doesn't need to change and will span sections. It's only when the centered page (the one controlled by word's page formatting) changes from the previous that the math need to change.

2016-06-21 22:53:40


I tried so many times. The precise order of character entry and ctrl-F9 seems to have differentiated these instructions from all the others out there.
The goal with one unnumbered cover, roman contents and a page of pages: (. is a space and word seems to need them)(center page # controlled by words numbering format system)
filename ii Page 3 of 30

{.FILENAME.*.MERGEFORMAT.} tab {.PAGE.} tab Page.{.=.{.PAGE.*.Arabic.*.MERGEFORMAT.}+1}.of.{.NUMPAGES.*.Arabic.*.MERGEFORMAT.}

and once the roman # stop:

{.FILENAME.*.MERGEFORMAT.} tab {.PAGE.} tab Page.{.=.{.PAGE.}+4}.of.{.NUMPAGES.*.Arabic.*.MERGEFORMAT.}

I tried to remove many of the spaces and it stopped producing results..many hours on this.

2016-04-05 14:14:56


I have both a title page and a few contents pages with Roman Numerals (Table of Contents, Table of Figures, List of Tables, and Abbreviations Used) before my document really starts followed by an appendix. My document is far from being complete at this point so I am anticipating the number of contents pages to increase as well as the total length of my document.

My document currently have 4 section which are the Title Page, the Contents Pages, the Document, and the Appendix.

I have all of the X pages numbers correct but is there a way to get my Y correct without having to change the field codes as my document increases in size (and potentially adds additional sections for additional Appendices)?

The current Appendix needed to have the pages in landscape to properly display the tables contained within it which is why the section break was needed versus a page break.

2016-03-28 12:28:04


Thank you so much!!!!! This is exactly what I was looking for.

I've always been so frustrated with the page numbering mechanics in Microsoft Word, especially regarding the Page X of Y format. When I add a Title Page and Table of Contents, the numbering format always messes up. Furthermore, I often write surveys where there will be many section breaks within the document so sometimes the page numbering goes awry. Thank you again for sharing this information :)

2016-03-22 01:53:06


Hi, what I need to know is this: How can I change Word's character counter to a page counter? I print out lots of articles (after I copy and paste them to a Word doc) and need to know in advance how many pages are going to print out.
I've Googled this question several times but only get tutorials about the word counter.
Any advice would be appreciated!

2016-03-15 13:40:54


I have a 2nd section break to change the orientation of the next page in my document. I want that page to be included in my total number of pages however. Do I place my insertion point before the Y on that specific page or the Y on page #1 of my document?

Thank you so much for your website!

2016-03-04 17:15:00


This was very helpful. The only tip I found that fully understood what was needed.

@Ferry, the answer to your question is buried in the text of this page -- divide your doc into 2 sections and use { SECTIONPAGES } instead of { NUMPAGES } will give you the total number of pages in the section.

2015-12-05 18:03:03



After hours of googling, yours was the only article that actually understood the problem and had the simple solution!

2015-11-06 22:33:44


Worked great, thank you

2015-10-10 15:22:26


Wow! you made my day. Thank you so much.

2015-09-22 13:44:57

Charudatta Kulkarni

Thank you Allen,
Its very useful tip for me. I am preparing number of RFP for our institute. Love to create multi sectioned documents.

2015-07-22 22:25:04


All I can say this tip Super matic..Grease lightning!!


2015-06-12 03:58:42

Hui Wen


Use Ctrl + F9 to generate the {} field code instead of manually typing it.

Hope it helps.

2015-04-17 20:09:39


This is great, but my Table of Contents does not reflect the change. Can you tell me how to get my ToC to show the number on the page, not the actual page count number?

2015-04-14 20:27:54


I have tried the formula every which way and I continually get an error code (Syntax Error, {) HELP! Is there any other way of adjusting the total page to exclude the title page?

2015-03-04 05:44:24


I had tried for years to do this. An illumination.



2015-02-11 17:50:10


Thank you so much

I have tried for years to do that. So excited

Best wishes

2015-01-15 08:19:21


This is a great help, but is it also possible to for example want to merge 2 word docs and have the x of Y page numbers to stop at the new document?

I got to the point where I found how to add page X of Y and with sections to restart the count of X but not the Y.

I need to restart the Y aswell :)
Hope you have a solution

2014-11-29 05:53:16


Excellent, my dear Allen!

I fully agree with Catherine. Your hint was much better than the support provided by Microsoft! It was very useful, and it did work!

2014-11-18 11:47:56


Thank you. I have had documents with cover pages at work for years and have used the section page trick as work around to exclude the cover page in the numbering. Was creating a multi-sectioned document and noone else explained how to edit the NUMPAGES field as clearly.

2014-11-02 05:21:03


Thanks a Lot.

2014-09-25 00:28:34


Thank you so much for this tip! I had a cover page and wanted my numbering to start as page 1 of Y on page 2 of the document, but that meant Y was 1 number too high! So I used your trick and it was perfect, thank you!

2013-09-11 11:13:06


I use an enhancement of Sharon's tip to display an X of Y sub-range within a document, leaving the footer page number intact. I add an 'End' bookmark to the last page of the sub-range and a 'Start' bookmark to the first page of the sub-range. The X of Y field codes become:
X: { = PAGE - Start +1 }
Y: { = End - Start +1 }
where Start and End refer to the PAGEREF on which the bookmark is located.

2013-08-10 04:40:27


Great tip! Another method is to place a bookmark at the very end of the document (such as enddoc - I usually place it on its own line if possible) and in the footer delete the {numpages] code and using the Insert tab, insert a Cross Reference to the page number of that bookmark. Of course, if you delete that last page when editing the document, be sure to recreate that bookmark at the end of the new document.

This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.