Writer

Markdown TOC Generator

Generate a table of contents from Markdown headings.

All tools

Markdown

Table of contents

- [Introduction](#introduction)
  - [Getting started](#getting-started)
    - [Install](#install)
  - [Usage](#usage)
- [Reference](#reference)

Frequently asked questions

Which heading levels are included in the table of contents?
By default H1 through H6 are detected, with indentation reflecting the heading hierarchy. You can usually limit the depth when you only want top-level sections.
How are anchor links generated for each heading?
Headings are slugified to lowercase, with spaces replaced by hyphens and punctuation stripped, matching the anchor format GitHub and most static site generators use.
What happens with duplicate heading names?
Repeated heading text produces duplicate slugs, which most renderers disambiguate by appending -1, -2, and so on. Renaming duplicates is the cleanest fix when generating the TOC.