Office Settings & Configuration

How to Fix Word Showing Field Codes Instead of Page Numbers or TOC

Adam DavisAdam Davis Nov 2, 2026 870 views

Question details

Microsoft Word is displaying raw field codes instead of the expected page numbers, table of contents, and figure references.

How to Fix Word Showing Field Codes Instead of Page Numbers or TOC
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.
Before you start

Ensure your document actually contains generated page numbers or a generated table of contents, rather than manually typed bracketed text that mimics field codes.

Solution 1Recommended

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.

1
Open your document

Open the Microsoft Word document where the field codes (like { PAGE \* MERGEFORMAT }) are currently visible.

2
Press Alt+F9

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.

Use the Alt+F9 Keyboard Shortcut
Quick Toggle: Using Alt+F9 changes the view for the entire document at once. If your keyboard has an Fn key lock, you might need to press Alt+Fn+F9 instead.
Free Microsoft Office alternative

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.

Highly compatible with Microsoft Word (.docx) file formats.Intuitive and clean interface that prevents accidental layout or code changes.Lightweight software that runs smoothly on most operating systems.Free to use for everyday document processing, reading, and editing.
microsoft office alternative - wps office

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.