logo
search
Document Editing Problems

How to Insert and Calculate Page Numbers with Field Codes in Word

Maira MehtabMaira Mehtab Sep 29, 2026 868 views

Question details

The user needs to insert or mathematically calculate a customized page number in a Word document using manual field codes.

How to Insert and Calculate Page Numbers Using Field Codes in Word
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.
Before you start

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.

Solution 1Recommended

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.

1
Position your cursor

Double-click the header or footer area, or place your cursor anywhere in the document body where you want the page number to appear.

2
Insert the field code brackets

Press the Ctrl + F9 keys simultaneously. This will insert a pair of curly braces { } with your cursor blinking inside them.

3
Type the PAGE field

Inside the curly braces, type the word PAGE so it looks exactly like { PAGE }.

4
Update the field to show the result

Press the F9 key to update the field. The code will disappear and display the current page number.

Insert a Standard Page Number Using the PAGE Field
Pro Document Editing

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. 1. Open your document in WPS Writer: Launch WPS Office and open your document to begin editing.
  2. 2. Access the header or footer: Navigate to the Insert tab and click on Header and Footer to enter editing mode.
  3. 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.
Seamless compatibility with Microsoft Word documents (.docx) and field codesAdvanced header and footer editing tools for dynamic page numberingLightweight program with an intuitive, user-friendly interfaceFree access to robust word processing and formatting features
microsoft office alternative - wps office

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.