How to Fix Word Showing Field Codes Instead of Page Numbers or TOC
Question details
Microsoft Word is displaying raw field codes instead of the expected page numbers, table of contents, and figure references.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Editing a document containing automated elements like page numbers, tables of contents, or citations.
- Observed behavior
- The document shows raw field codes such as { PAGE \* MERGEFORMAT } on the screen, although it continues to export correctly to PDF.
Ensure your document actually contains generated page numbers or a generated table of contents, rather than manually typed bracketed text that mimics field codes.
Use the Alt+F9 Keyboard Shortcut
The fastest and most direct way to toggle between displaying field codes and displaying their actual results in Microsoft Word.
Microsoft Word includes a built-in keyboard shortcut designed to toggle the view of all field codes in the active document. Accidental pressing of this combination is usually the cause of the problem.
Open the Microsoft Word document where the field codes (like { PAGE \* MERGEFORMAT }) are currently visible.
Press the 'Alt' and 'F9' keys on your keyboard simultaneously. This will instantly switch the document back to displaying field results, restoring your page numbers and tables of contents.

Change Field Code Display Settings in Word Options
If the keyboard shortcut does not resolve the issue, you can manually disable the field code display directly within the Word Options menu.
Seamlessly Edit Documents with WPS Office
Tired of confusing settings and sudden formatting changes in Microsoft Word? Try WPS Office. It provides a highly compatible, intuitive interface where page numbers and tables of contents are displayed correctly by default, saving you troubleshooting time.

Frequently Asked Questions
Why did my Word document suddenly start showing field codes?
This usually happens because you or a connected application accidentally triggered the Alt+F9 keyboard shortcut, which is Microsoft Word's default command to toggle between viewing underlying field codes and their actual values.
How do I show or hide field codes for just a single field?
To toggle the field code for a specific element without affecting the entire document, click inside the specific field (such as a single page number or citation) and press Shift+F9.
Will field codes print if they are currently visible on my screen?
Yes, if the document is actively set to display field codes instead of values, or if the 'Print field codes instead of their values' setting is enabled in the Print options, they may appear on your printed pages. Always toggle back to standard view (Alt+F9) before printing.




