Last Name and Page Number in Word: How to Add Both

How-to basics · Updated November 3, 2026

Last Name and Page Number in Word: How to Add Both

To put your last name and an automatic page number on every page in Word, edit the header, right-align the line, type your surname and a space, then insert a page-number field at the cursor. Word updates the field as pages are added or removed. The steps below are for Microsoft Word for Microsoft 365 on Windows, with Mac and Word for the web notes where the controls differ. You do not need to type the page numbers yourself.

What You’ll Need

  • A Word document open in the desktop app, or Word for the web.
  • The surname you want displayed. If you are following a school or workplace style guide, check whether it asks for a particular header position, font, or first-page treatment.

Step-by-Step

  1. Open the document and check the page layout. Save a copy if you are making changes to a final document, and make sure you are editing the right file. The usual setup places the surname and page number in the header, at the top-right of each page. If your assignment instructions specifically request a footer or a different location, use that location instead; the page-number field works there too.
  2. Open the header. In Word for Microsoft 365 on Windows, double-click near the top margin of a page, above the main text. Word opens the Header & Footer editing area. You can also use Insert > Header > Edit Header. If the header area is difficult to reach, choose the menu command rather than clicking. On a Mac, double-click the top margin or use Insert > Header and choose an edit option; the wording can vary slightly by Word release.
  3. Right-align the header paragraph. Click in the header line where the text will go. On Windows, press Ctrl+R, or choose Home > Align Right. On Mac, use Command+R or Home > Align Right. The insertion point should move to the right edge of the header area. Right alignment applies to the paragraph, so both the surname and number will sit together at the right rather than being separated across the line.
  4. Type the surname and a space. Enter the last name exactly as it should appear, then press the spacebar once. For example, if the surname is Rivera, type Rivera followed by one space. Do not type a page number after it: the next step inserts a field that changes automatically from page to page. If the required format uses an initial or another label, follow the instructions you were given.
  5. Insert the page-number field at the cursor. In Word for Microsoft 365 on Windows, select Insert > Page Number > Current Position > Plain Number. This places the number at the current insertion point, after the surname and space. Because the paragraph is right-aligned, the combined text remains at the right edge. If Current Position is unavailable, confirm that you are editing the header, then open the Page Number menu again. On Mac, use Insert > Page Number and choose the option for inserting a number in the current header or at the cursor if it is offered. Some Mac versions show a placement dialog; select the header and right alignment, then confirm.
  6. Check that the number is a field, not typed text. Click in the number area. A page-number field may show a gray background when selected, depending on your Word settings. You can also move to another page: the number there should be different. The gray shading is only an on-screen field indicator and does not print. If you accidentally typed a numeral instead, delete it and insert the field using the menu path above.
  7. Review the first and later pages. Scroll through the document and check that the surname and page number appear in the intended position on several pages. The first page may look different if Different First Page is enabled, or if the document has section-specific headers. If you want the same header everywhere, make sure those options and any section breaks match your requirements.
  8. Close the header and save. Choose Header & Footer > Close Header and Footer, or double-click in the main body of the document. Save with Ctrl+S on Windows or Command+S on Mac. For a final check, use File > Print or print preview to inspect the pages; the header should appear in the same location without covering the body text.

If you prefer to start with a preformatted header, you can choose Insert > Page Number > Top of Page and select a right-aligned design. Then edit the header and place the surname before the page-number field. The Current Position method above is usually easier when the surname and number need to form one continuous line.

Common Mistakes

  • Typing the number instead of inserting a field. A typed 1 stays 1 on every page. Use Insert > Page Number to create an automatic field, which Word can update when the document changes.
  • Choosing Top of Page when already inside the header. Top of Page adds a preset header layout and can replace or rearrange existing header content. If you have typed the surname in the header, use Current Position so the number is inserted where the cursor is.
  • Leaving the paragraph left-aligned. Right-align the line before typing the surname and inserting the field. If you align it afterward, click in the same header paragraph first so the alignment applies to the complete line.
  • Adding extra spaces to position the text. Repeated spaces can shift unpredictably when fonts, margins, or page sizes change. Use paragraph alignment or tab settings instead of spacing the text by eye.
  • Editing only one section by mistake. A section break can let one header differ from another. If the header changes partway through the file, check whether Link to Previous is enabled for that section and whether a different first-page header is active.
  • Putting the surname in the body. Text typed just below the top margin may look like a header on the first page but will not repeat on later pages. Make sure the Header & Footer editing area is open when entering it.

Tips

  • Follow the required style, not a general template. Many academic formats place the surname and page number at the upper right, but requirements vary. Confirm whether the title page should be numbered, whether the first page needs the same header, and whether the number begins at 1.
  • Keep the surname and field in one paragraph. A single right-aligned paragraph is simple to edit and keeps the two parts together. If your document uses an existing header layout, inspect its tabs and spacing before changing the whole header.
  • Use the number format controls only when needed. To change numbering style or starting value in Word for Windows, choose Insert > Page Number > Format Page Numbers. The dialog lets you select a number format and, where appropriate, choose a starting number. On Mac, look under Insert > Page Number for the format or numbering options available in your version.
  • Know the difference between a page and a section. A document can contain several sections, each with its own header settings. When you add a section break, Word may continue the previous header or let you change it. Check each section if the header needs to remain consistent throughout.
  • Check the exported or printed version. A header can appear correctly in the editing view but be hard to see if the top margin is too small or the text is too close to the paper edge. Use print preview or export a PDF and inspect the first, middle, and last pages.

Troubleshooting

The surname appears, but the number does not. Click immediately after the surname in the header and insert the page number using Insert > Page Number > Current Position > Plain Number on Windows. If the menu does not show Current Position, make sure the header is being edited rather than the document body. On a Mac, open the page-number command while the header is active and select the header placement.

The same number appears on every page. It was probably typed as ordinary text. Delete the repeated numeral, leaving the surname and its space, then insert a page-number field. Go to another page to verify that Word displays the next number. If the numbering restarts unexpectedly, open Format Page Numbers and review whether numbering is set to continue from the previous section or start again.

The header is missing from the first page. Double-click the header and look in the Header & Footer tab for Different First Page. If it is selected, Word keeps a separate first-page header. Turn it off if the first page should match the rest, or leave it on and add the surname and page number to the first-page header if your instructions require them there.

The header changes after a certain page. Turn on formatting marks with Home > Show/Hide ¶ and look for a section break near the point where the change begins. Open the header in the new section and check Link to Previous on the Header & Footer tab. Linking the section to the previous one usually carries the same header forward; unlinking it allows a different header. Make the choice deliberately, since changing a linked header can affect earlier sections.

The text is on the left or the number is separated from the surname. Click in the header paragraph and choose Home > Align Right. Remove any extra tabs or spaces between the words and field, then type one space between the surname and number. If the existing header contains tab stops, a preformatted layout, or multiple paragraphs, clear or adjust those elements rather than pressing the spacebar repeatedly.

The menu names are different or the command is unavailable. Word for Mac and Word for the web do not always show the same galleries as Word for Windows. In Word for the web, use Insert > Page Numbers and select a header layout; edit the header to add the surname. If you cannot insert the number at the exact cursor position or change section settings in the web app, open the document in the desktop version of Word and use the steps above.

Frequently Asked Questions

How do I add my last name and page number in Word for MLA?
Usually, you put the surname, one space, and an automatic page-number field in a right-aligned header. Check your instructor’s current directions for details such as whether the first page should display the header.

Will the page number update when I add or remove pages?
Yes. A number inserted through Word’s Page Number command is a field, so Word updates it as the document’s pagination changes. A number typed directly into the header will not update automatically.

Can I put the surname and number in the footer instead?
Yes. Open the footer by double-clicking near the bottom margin, right-align the paragraph, type the surname and a space, then insert the page-number field at the cursor. Follow any required style instructions about placement.

How do I leave the first page unnumbered?
Open the header and select Different First Page on the Header & Footer tab. This creates a separate first-page header. You can leave it blank while keeping the surname and number in the regular header on later pages. If numbering must still begin at 1 on the second page, review the page-number format settings.

Can I start page numbering at a number other than 1?
Yes. In Windows Word, choose Insert > Page Number > Format Page Numbers and set Start at to the required value. For a document with sections, check the setting in the relevant section so the numbering does not restart or continue unexpectedly.

Why does my header not show in every section?
Section headers can be independent. Open the header in the section where it is missing and check Link to Previous. Also inspect Different First Page and Different Odd & Even Pages, because either option can create a separate header that needs its own content.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.