How to Insert and Calculate Page Numbers with Field Codes in Word
Question details
The user needs to insert or mathematically calculate a customized page number in a Word document using manual field codes.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Adding dynamic standard or modified page numbers into a document's header, footer, or body text.
- Observed behavior
- The user wants to display customized page numbers rather than using the default page number insertion tool.
Ensure you know exactly where you want the page number to appear (e.g., header, footer, or document body) and keep in mind that calculating a custom page number will not change how it is listed in an automated Table of Contents.
Insert a Standard Page Number Using the PAGE Field
Use the basic PAGE field code to display the current page number anywhere in your document.
This is the most straightforward method for manually inserting dynamic page numbers without using the ribbon interface.
Double-click the header or footer area, or place your cursor anywhere in the document body where you want the page number to appear.
Press the Ctrl + F9 keys simultaneously. This will insert a pair of curly braces { } with your cursor blinking inside them.
Inside the curly braces, type the word PAGE so it looks exactly like { PAGE }.
Press the F9 key to update the field. The code will disappear and display the current page number.

Calculate a Modified Page Number Using Nested Formula Fields
Use a nested formula field to perform mathematical calculations on the current page number, such as adding or subtracting a specific value.
Easily Manage Page Numbers and Field Codes in WPS Writer
WPS Office Writer offers comprehensive support for field codes, allowing you to insert, calculate, and expertly format page numbers. Enjoy a professional word processing experience that fully mirrors industry-standard document editing features.
- 1. Open your document in WPS Writer: Launch WPS Office and open your document to begin editing.
- 2. Access the header or footer: Navigate to the Insert tab and click on Header and Footer to enter editing mode.
- 3. Use field codes to customize numbering: Press Ctrl+F9 to insert field braces, type PAGE or your calculation formula, and press F9 to display the results.

Frequently Asked Questions
Why isn't my calculated page number showing in the Table of Contents?
Word's internal features, such as the Table of Contents, Indexes, and Cross-references, are programmed to pull the actual physical PAGE field value. They cannot read or display the mathematically modified number you created using a calculation field.
How do I edit a field code after I have updated it?
To view and edit the underlying field codes instead of their calculated results, press Alt + F9 on your keyboard. This toggles the display between field codes and field results for the entire document. Once edited, press F9 to update.
Can I format the page number field code to display Roman numerals?
Yes. You can add a formatting switch to the PAGE field. For example, editing your field to look like { PAGE \* Roman } and pressing F9 will display the page numbers as uppercase Roman numerals.




