How to Use Field Codes in MS Word to Show Only Even or Odd Page Numbers

Sandeep Agarwal

Back in my schooling days, the thought of writing page numbers on a Word document used to ring alarms in my head. That is because I did not know about the Insert Page Number feature. Yes, it’s hard to believe that I used to do it manually.

Time started giving me tougher requirements; like showing page numbers on only even or only odd pages, starting numbering from the third page, no numbering on selected random pages, etc. I started learning, and today, I am able to play with page numbers in multiple ways. Thanks to MS Word Field codes.

Image via Shutterstock

Today we will take on one among those many situations and discover the magic behind getting the task done. We will see how to show page numbers on only even or odd pages.

A Bit on Field Codes

Field codes can be used to insert dynamic content in a Word document. They are like placeholders for values that change according to an algorithm with specific references. If you have no knowledge on this topic, I strongly recommend you read this article from Microsoft. And you must also learn how to insert field codes by reading this.

Note: Always create the braces by pressing Ctrl + F9 (that’s the simplest and quickest way). Typing braces will be treated as normal text and not field codes.

Method 1

Step 1: Insert a blank header or footer based on where you want the page numbers to appear. To do that, navigate to Insert -> Header/Footer.


Step 2: Under Header & Footer Tools, Design, check Different Odd & Even Pages.


Step 3: Scroll to one of either an even or odd page based on which page you want to show the numbers (I will take odd in this example). Press Ctrl + F9 together. That will show a pair of curly braces { }.


Step 4: Inside the brackets type the field code PAGE. Then press Alt + F9 or Shift + F9 to calculate and display the value of the code.


Note: Shift + F9 calculates the value of the selected field codes. Alt + F9 calculates the values of all the field codes in the document.

Method 2

The first method is definitely simpler and easier than what we are going to discuss. But this one’s important as it will unfold the larger capabilities of field codes. It will help you do more than just even/odd with page numbers.

Step 1: Insert a blank header or footer based on where you want the page numbers to appear. To do that, navigate to Insert -> Header/Footer.


Step 2: Create this field { IF{ =MOD({PAGE}, 2) } = 0 “” “{ PAGE }”} for numbers on odd pages and { IF{ =MOD({PAGE}, 2) } = 0 “{ PAGE }” “”} for numbers on even pages. Do it step by step:

  1. Press Ctrl + F9 to create the outer set of curly braces
  2. Type IF inside
  3. Press Ctrl + F9 to open another set of curly braces
  4. In it type =MOD
  5. Open and close round brackets
  6. Inside round brackets, open one more set of curly braces
  7. Type PAGE in it
  8. Then , 2
  9. Outside braces you created in 3, evaluate the expression to 0
  10. Follow with space, inverted commas, space, inverted commas
  11. Create another field code for PAGE inside the desired inverted commas



Step 3: Press Alt + F9 to calculate. You have the result you wanted.


Don’t you think this is interesting. I used MOD to determine if a page was odd or even. On true it shows the value in the first inverted comma and on false the value from the second. Why don’t you try the other scenarios I mentioned in the beginning?

Also See

Join the newsletter