Tab stops and the TOC styles decide how a Word table of contents lines up, so fixes made there are the ones that hold when Word rebuilds the table. To line the page numbers up along the right margin, go to References > Table of Contents > Custom Table of Contents and check Right align page numbers.
Start by matching what you see on the page to its cause. Each fix below works in Word for Microsoft 365 on Windows and Mac.
What looks wrong with your table?
| What you see | Likely cause | Where to fix it |
|---|---|---|
| Page numbers sit right after each heading instead of lining up on the right | Right align page numbers is off | Custom Table of Contents dialog |
| No dots between headings and numbers, or the wrong kind of line | Tab leader setting | Custom Table of Contents dialog |
| One level is indented too far, or in a different font from the others | That level’s TOC style | Modify, in the same dialog |
| A long entry wraps and its second line runs under the number | No hanging indent in that level’s style | Paragraph settings for the style |
| Your fixes vanish after you update the table | Formatting was applied by hand to the table text | The TOC styles, then update again |
| Nothing changes when you update | The table was typed by hand | Insert a new, automatic table |
If the document has no automatic table yet, create a table of contents in Word first, then come back to adjust the alignment.
Line up the page numbers on the right
Microsoft’s page on how to format or customize a table of contents puts the alignment settings in one dialog. The steps are the same in Word for Windows and Word for Mac.
- Click anywhere inside your table of contents.
- Go to References > Table of Contents and select Custom Table of Contents.
- Make sure Show page numbers is checked. It turns the page numbers and the tab leader on or off together.
- Check Right align page numbers. Microsoft says this puts the numbers along the right margin; clearing the box puts them next to the headings.
- Open Tab leader and pick dots (the default), dashes or a solid line, or choose (none) for a blank gap.
- Check the preview, then select OK. If Word asks whether to replace the current table, accept so the new settings apply.

Changed your mind before you select OK? Microsoft notes that Cancel drops all the changes you made in the dialog. The Custom table of contents dialog reference also describes the other boxes, such as Show levels, which controls how many heading levels appear.
To center the Contents title above the entries, click anywhere in the title, then on the Home tab, in the Paragraph group, select Center Text, as in Microsoft’s align or justify text steps.
Set the indent and font in each level’s style
Word formats every level of the table with its own style: one for entries from Heading 1, another for Heading 2, and so on. Changing a level’s style changes every entry at that level at once, and the change stays when the table is rebuilt.
- Open References > Table of Contents > Custom Table of Contents.
- Select Modify. If Modify is grayed out, change Formats to From template first.
- In the Styles list, click the level you want to change, then click Modify.
- In the Modify Style dialog, change what is wrong. Microsoft’s style help lists font, size, color, alignment, line spacing and indentation in the Formatting section. The TOC levels have their own font settings, so this is also where you fix a table whose font differs from the body text.
- Select OK, then repeat for each level that needs it.
If the numbers stop short of the margin after you change page margins, open Custom Table of Contents again, keep Right align page numbers checked and select OK so Word applies it to the existing table. For how tab stops and leaders work in general, see setting multiple tabs in Word and Microsoft’s page on dots or leaders between tabs, where you choose an alignment, pick a leader under Leader, then select Set and OK.
Stop long headings running into the numbers
A long heading can wrap onto a second line that starts at the left edge, right under the entry’s first word, or runs toward the page number. A hanging indent keeps the second line tucked in under the text. Microsoft’s hanging indent steps are:
- Select the entry, then go to Home > Paragraph Settings dialog launcher.
- On the Indents and Spacing tab, under Special, select Hanging.
- Set the depth in the By box and select OK.
To make it hold for every entry at that level, set the indentation in that level’s style instead (see the previous section).
Shortening a very long heading in the document itself is often the cleaner fix, because the shorter text then fits on one line in the table as well.
Keep the fixes when you update
Microsoft’s update a table of contents page gives two choices after you select Update Table on the References tab:
- Update page numbers only refreshes the numbers and leaves heading text alone.
- Update entire table reflects changes to heading text as well as page changes, and rebuilds the entries.
Spaces, tabs or bold text typed straight into the table can disappear when Word rebuilds the entries, which is why the style route above is the lasting one. Microsoft also notes that a table created by hand, rather than from headings, can’t be updated by Word. If yours was typed manually, alignment fixes will never survive an update; replace it with an automatic table. Headings that land at the wrong level are fixed in the document, by giving the heading the right Heading style, not in the table.
Mac and Word for the web
Microsoft’s customization page shows the same References > Table of Contents > Custom Table of Contents steps for Word for Mac, so everything above applies there. Microsoft’s customization page covers Word for Windows and Mac and gives no Word for the web steps, so open the file in the desktop app when you need these settings.
If the problem is not the table of contents but text, tables or pictures elsewhere in the file, see fixing alignment in Word. Long manuals are where tables of contents get the most use; creating a user manual in Word covers the rest of that layout.
Contents alignment answers
Why is Modify grayed out?
The Formats box in Custom Table of Contents is set to one of Word’s built-in designs. Microsoft’s fix is to change Formats to From template, after which Modify works.
Can I remove the dots but keep the numbers on the right?
Yes. Leave Right align page numbers checked and set Tab leader to (none). The numbers stay at the right margin with a blank gap before them.
Can I show page numbers for some levels only?
The Show page numbers box applies to the whole table. For a table with fewer levels, lower the Show levels number instead.
What does Update page numbers only leave alone?
Heading text. If you renamed a heading, choose Update entire table so the new wording appears.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.