A table of contents is a clickable list at the start of your document that links to each section

Most document editors — Google Docs, Microsoft Word, LibreOffice Writer — can build a table of contents automatically if you use their heading styles correctly. You do not type it by hand. Instead, you mark each section title with a heading style (Heading 1, Heading 2, and so on), and the editor pulls those titles into a formatted list that updates itself when you add or rename sections.

The privacy angle matters here: if you are choosing an editor partly for how it handles your data, a table of contents is one of the features that works the same way across privacy-conscious and mainstream options. It is a built-in feature, not something that requires cloud sync or external tools. You can create one offline in LibreOffice or Calligra, or online in Google Docs or Microsoft 365, and the process is nearly identical.

Key Takeaways

  • A table of contents pulls automatically from heading styles you explore to section titles, so you must use Heading 1, Heading 2, or similar — regular bold text will not work.
  • In Google Docs, insert a table of contents from the Insert menu, and it updates itself whenever you change a heading.
  • In Microsoft Word, use the References tab to insert a table of contents, and refresh it before you print or share the document.
  • In LibreOffice Writer, go to Insert > Table of Contents and choose your formatting style, then update it the same way you would in Word.
  • A table of contents only works if your document is long enough to benefit from one — typically at least 5 to 10 sections.

How to mark sections with heading styles in Google Docs

Open your document and highlight the text of your first section title. At the top left, you will see a dropdown that says "Normal text" or "Paragraph". Click it and select "Heading 1". Repeat this for every major section title in your document. If you have subsections under those titles, mark those with "Heading 2" instead.

The key is consistency: all your main sections should be Heading 1, all your subsections should be Heading 2, and so on. Google Docs will not include a heading in the table of contents if you use a different style — for example, if you mark one section as Heading 1 and another as bold text that looks like a heading.

Once you have marked all your headings, go to Insert > Table of Contents. Google Docs will show you a preview of what the table will look like. Click the style you prefer — usually the first option, with blue links — and Google Docs inserts it at the cursor. The table updates automatically whenever you change a heading or add a new one.

How to mark sections with heading styles in Microsoft Word

Highlight your first section title and go to the Home tab. In the Styles section, click "Heading 1". Do the same for every major section, using "Heading 2" for subsections. Word works the same way as Google Docs: it looks for these specific styles, not for text that just looks like a heading.

Once your headings are marked, go to the References tab at the top. Click "Table of Contents" and choose a style. Word inserts the table at your cursor. Unlike Google Docs, Word does not update the table automatically — you have to right-click it and select "Update Field" whenever you change a heading or add a new section. This is important to do before you print or share the document, or the page numbers will be wrong.

How to mark sections with heading styles in LibreOffice Writer

Highlight your first section title. Go to Format > Paragraph, or right-click and select Paragraph. In the Organizer tab, find the Style dropdown and select "Heading 1". Close the dialog. Repeat for every major section, using "Heading 2" for subsections.

Alternatively, you can use the Styles sidebar on the right side of the screen. If you do not see it, go to View > Styles. Highlight a heading and double-click "Heading 1" in the sidebar. This is faster if you have many headings to mark.

Once your headings are marked, go to Insert > Table of Contents. A dialog opens. The default settings usually work fine — it will pull from Heading 1, Heading 2, and Heading 3. Click OK. LibreOffice inserts the table at your cursor. To update it later, right-click the table and select "Update Index".

Why heading styles matter for privacy and portability

Using proper heading styles instead of just making text bold or large has a hidden benefit: your document stays readable and editable if you move it between editors. If you export a Google Doc to Word, or save a Word file as an OpenDocument format that LibreOffice uses, the headings come with you. The table of contents can be rebuilt in the new editor without you having to remark every section.

This matters for privacy because it means you are not locked into one editor's format. If you decide to switch from a cloud-based editor to an offline one for privacy reasons, or vice versa, your document structure is portable. The heading information is stored as metadata in the file, not as formatting tricks that only one program understands.

When a table of contents does not work

The most common problem is that you marked some headings with a style and others with bold text or a larger font size. The table of contents will only include the ones marked with a style. If your table looks incomplete, go back through your document and check that every section title uses Heading 1, Heading 2, or another heading style — not just formatting.

Another issue is that you inserted the table of contents before you finished writing the document. This is fine — you can insert it at any point. But remember that in Word and LibreOffice, you have to update the table manually before you share the document. In Google Docs, this happens automatically, so you can insert the table early and not worry about it.

If your document is very short — fewer than 5 sections — a table of contents may not be worth the space it takes up. It is most useful for documents longer than 10 pages or with more than 8 sections.

How to format and customize your table of contents

In Google Docs, you can change the table of contents style by deleting it and inserting a new one with a different style. You cannot edit the individual entries — they update automatically from your headings.

In Word, right-click the table and select "Table of Contents" to change the style. You can also right-click and select "Edit Field" to adjust which heading levels are included (for example, to show only Heading 1 and Heading 2, not Heading 3).

In LibreOffice, right-click the table and select "Edit Index" to change the style or adjust which heading levels appear. You can also choose whether page numbers appear and where they sit on the line.

Frequently Asked Questions

Can I create a table of contents if I have not finished writing yet?

Yes. Insert the table of contents whenever you want — it will pull from whatever headings exist at that moment. In Google Docs, it updates automatically as you add more sections. In Word and LibreOffice, you will need to update it manually before you share or print the document.

What if I want to change a heading after the table of contents is already there?

Just change it. In Google Docs, the table updates automatically. In Word and LibreOffice, right-click the table and select "Update Field" or "Update Index" to refresh it with the new heading text and page numbers.

Can I delete or move the table of contents?

Yes. Click anywhere in the table and delete it like any other content. You can insert a new one later if you change your mind. Deleting the table does not affect your headings — they stay in the document.

Does a table of contents work the same way if I read my document as a PDF?

In Google Docs and Word, the links in the table of contents become clickable bookmarks in the PDF. In LibreOffice, this depends on your export settings — check the PDF export dialog to enable hyperlinks if they do not appear automatically.

What if my document has no headings at all?

The table of contents will be empty or will not insert at all. You have to mark at least some section titles with heading styles first. If you have a document with no clear sections, a table of contents is not necessary.