ScreenshotNeo

BlogHow-to

Including a Table of Contents in a DOCX Document

Learn how to add an automatic, refreshable table of contents to a DOCX file in Word, fix missing entries, and keep page numbers accurate.

By the ScreenshotNeo team29 September 20269 min read

Including a Table of Contents in a DOCX Document

Direct answer: In Microsoft Word, apply built-in Heading 1, Heading 2, and Heading 3 styles to your section titles, place the cursor where the contents list should appear, then choose References > Table of Contents and select an automatic style. When the document changes, use Update Table. Choose Update page numbers only when pagination changed, or Update entire table when headings, wording, levels, or section membership changed.

This method works for DOCX files in Microsoft 365, Word 2024, Word 2021, Word 2019, and Word 2016 desktop editions on Windows and Mac. Word for the web supports built-in heading styles and inserting a table of contents, although some style-editing features require desktop Word. Exact menu labels can vary slightly by platform and Word release. Microsoft’s official instructions cover insertion, heading styles, and updates in detail: Insert a table of contents, Update a table of contents, and Add a heading in a Word document.

1. Prepare the DOCX structure with heading styles

An automatic table of contents reads Word’s document structure. It does not identify headings reliably from font size, bold text, spacing, or capitalization alone. Apply a built-in heading style to every title that should appear in the table.

Heading styles give Word the structure it needs to build an automatic table of contents.
Heading styles give Word the structure it needs to build an automatic table of contents.

Choose heading levels consistently

  • Heading 1: major sections or chapters.
  • Heading 2: subsections inside a Heading 1 section.
  • Heading 3: topics inside a Heading 2 section.
  • Normal: paragraphs, captions, notes, and body text that should not appear.

For example, a report might use Heading 1 for “Introduction,” “Methods,” and “Results”; Heading 2 for “Data collection” and “Analysis”; and Heading 3 for smaller subsections. Keep the hierarchy logical. A Heading 3 directly under a Heading 1 may be valid, but readers usually understand the structure more easily when levels are nested in order.

Apply a heading style

  1. Select the section title.
  2. Open Home > Styles.
  3. Choose Heading 1, Heading 2, or Heading 3.
  4. Repeat for every title that belongs in the table.

Using styles also gives you consistent formatting and improves navigation through Word’s Navigation Pane. If you need a different appearance, modify the style rather than manually formatting each heading. Word for the web supports applying built-in styles; creating or editing style definitions may require the desktop application, according to Microsoft’s guidance on styles in Word for the web.

2. Insert an automatic table of contents

Place the insertion point where the table should appear. In most reports, books, and specifications, this is near the beginning, after a cover page and before the first body section.

Windows or Mac desktop Word

  1. Click the location where the table should be inserted.
  2. Open the References tab.
  3. Choose Table of Contents.
  4. Select one of the automatic table styles.

Word inserts entries based on the heading styles and adds page numbers. The table is a field, so it can be refreshed after editing. Do not choose a manual table if you need automatic maintenance: a manual table uses placeholder text and does not build entries from your headings.

Word for the web

In Word for the web, apply the built-in heading styles first, place the cursor, then use References > Insert Table of Contents and select a style. If the command is unavailable or a style needs deeper customization, open the document in desktop Word.

Control the number of heading levels

For a large document, showing every Heading 3 can make the front matter difficult to scan. Use the custom table-of-contents options to choose how many heading levels appear. A short policy document may need only Heading 1 and Heading 2; a technical specification may need three or more.

Automatic tables can be adjusted without replacing the underlying heading structure. Common settings include:

  • Show page numbers: useful for printed documents; optional for screen-only documents.
  • Right-align page numbers: keeps page numbers in a predictable column.
  • Tab leader: dotted leaders connect the title to its page number.
  • Formats: choose a predefined visual style.
  • Show levels: controls whether Heading 1, Heading 2, Heading 3, and deeper levels are listed.
  • Hyperlinks instead of page numbers: helpful in a digital DOCX because readers can click an entry to jump to the heading.

To change these options, open References > Table of Contents > Custom Table of Contents. The available labels can differ between Word versions. If you change fonts or indentation, prefer modifying the table’s styles so the formatting remains consistent when the field is regenerated.

4. Refresh the table after editing

Word does not always refresh a table immediately after you edit the document. Update it before sharing, exporting, or printing.

Update page numbers for pagination changes and the entire table when the document structure changes.
Update page numbers for pagination changes and the entire table when the document structure changes.
  1. Click anywhere inside the table.
  2. Choose Update Table or right-click and choose Update Field.
  3. Select the update scope that matches the change.
What changed? Choose Why
Text moved and page locations changed, but headings and sections are unchanged Update page numbers only Recalculates locations while retaining the existing entries
A heading was renamed Update entire table Refreshes the displayed title and its page number
A section was added or removed Update entire table Adds or removes entries
A heading level changed Update entire table Rebuilds indentation and hierarchy
Several edits affected structure and pagination Update entire table Recalculates both entries and page numbers

Microsoft distinguishes page-number-only updates from entire-table updates in its table update guidance. Updating the entire table is the safer choice when you are unsure whether the structure changed.

5. Make the table reliable before delivery

Use a final refresh checklist

  • Every intended entry uses a built-in heading style.
  • Heading levels reflect the document hierarchy.
  • No body paragraph has accidentally been styled as a heading.
  • The table was updated after the final content edit.
  • Page numbers match the final pagination.
  • Hyperlinks work when the DOCX is viewed electronically.
  • The table does not include unwanted front-matter titles.
  • The document was saved after updating the field.

Update fields before printing on Windows

Word for Windows includes an option to update fields before printing. Open File > Options > Display, find the printing options, and enable Update fields before printing. This Windows-specific setting helps reduce the chance of printing an out-of-date table. The available path is not established for every platform, so verify the equivalent behavior on Mac or Word for the web before relying on it.

6. Troubleshooting common problems

An entry is missing

Cause: The title may only be bold or large, rather than assigned a heading style. It may also use a custom style that is not mapped to a table level.

Fix: Select the title, apply Heading 1, Heading 2, or Heading 3, then update the entire table. If you must use a custom style, map it through the custom table-of-contents options.

An ordinary paragraph appears in the table

Cause: The paragraph has a heading style applied accidentally, or a custom style is mapped to a table level.

Fix: Select the paragraph and apply Normal (or the correct body style), then update the entire table.

The page numbers are wrong

Cause: The table field was not updated after text, spacing, images, or page breaks changed.

Fix: Click inside the table and choose Update Table. Use page numbers only when the entries are still correct; otherwise update the entire table.

Heading text changed but the old wording remains

Cause: Only page numbers were refreshed.

Fix: Run Update Table and select Update entire table.

The table shows no entries

Cause: No text is using the heading styles included in the table settings, or the field is a manually typed table.

Fix: Apply heading styles to the section titles. If it is a manual table, delete or replace it with an automatic table of contents.

Formatting changes disappear after an update

Cause: Direct formatting was applied to individual lines or entries, and regenerating the field rebuilt them from the table styles.

Fix: Modify the relevant table-of-contents styles, such as TOC 1 or TOC 2, then update the table.

The table is not clickable

Cause: Hyperlinks may be disabled in the selected table format, or the document is being viewed in an application that does not support Word fields fully.

Fix: Reinsert or customize the table with hyperlink support, save as DOCX, and verify it in Word. A PDF export may use different link behavior depending on the export settings.

7. Advanced cases and edge conditions

Appendices and front matter

Decide whether items such as an abstract, acknowledgements, list of figures, or appendices belong in the main table. Apply heading styles only to items you want listed. If an appendix needs a special label but should still appear, use a heading style and customize the displayed numbering separately.

Unnumbered headings

A table of contents and heading numbering are separate features. You can list headings without numbering, or use a multilevel list linked to heading styles for numbered chapters. If numbering changes, update the entire table so the displayed titles and hierarchy are rebuilt.

Long headings

Long titles can wrap across multiple lines in the table. Keep the document heading descriptive, then use a shorter custom table entry only when the shortened wording remains unambiguous. Avoid manually editing the generated field because the change may disappear at the next update.

Documents edited by several people

Ask contributors to use the shared heading styles instead of local formatting. Before release, inspect the Navigation Pane and run an entire-table update. This catches inconsistent levels and stale entries introduced during collaboration.

8. Performance, reliability, and file-size considerations

A table of contents is a lightweight field and normally has negligible impact on a DOCX file. The main reliability risk is stale field content, especially after late edits. A repeatable publishing step—update the entire table, inspect the first and last entries, save, then export—prevents most delivery errors.

For very large documents, limit the displayed heading depth to what readers need. Deep hierarchies make navigation harder and increase the chance that a minor formatting mistake creates an unwanted entry. Keep headings concise, use styles consistently, and avoid converting the table to plain text until the document is final; plain text cannot refresh automatically.

9. Or skip the browser setup

If your workflow also needs screenshots of the finished DOCX preview, a web document viewer, or any public page, ScreenshotNeo provides a single website screenshot API call. Its API is separate from Word’s table field, but it can help automate visual checks in publishing pipelines.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. An MCP server lets AI agents such as Claude and Cursor call take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Create a free ScreenshotNeo account and use the first 1,000 monthly screenshots without adding a card.

10. FAQ

Can I create a table of contents without heading styles?

You can type one manually or map custom styles, but an automatic table is most reliable when section titles use Word’s built-in heading styles.

Should I update page numbers or the entire table?

Use page numbers only when the headings and entries are unchanged. Use the entire table after renaming, adding, removing, or reordering headings.

Does Word for the web support automatic tables?

Yes. Word for the web supports built-in heading styles and inserting a table of contents. Desktop Word may be required for advanced style creation or editing.

Can I edit generated entries directly?

Do not rely on direct edits. Change the source heading or the table style, then update the field so the result persists.

Why does a manual table not refresh?

A manual table is ordinary placeholder text. Word has no heading-based field to regenerate, so replace it with an automatic table or maintain every entry by hand.

Sources