📑 Markdown TOC Generator
Build a table of contents from Markdown headings with GitHub-style anchors.
Last updated: November 8, 2026 · By the BoltQuickTools team
A table of contents that matches your headings
A hand-written contents list in a long README goes stale the moment someone renames a section. This page reads the headings in your Markdown and builds the nested list with anchor links, so you can regenerate it whenever the document changes.
Generating the list
- Paste your document into Markdown Input.
- Set Min depth and Max depth. The defaults of 2 and 4 skip a single H1 title and include H2 through H4.
- Choose Anchor style (GitHub, GitLab or Plain) and whether the list is Numbered.
- The Generated TOC updates as you type or change an option. Copy TOC copies it, and Generate simply reruns the same thing.
Input and output
With default settings, this document:
# My App
## Getting Started
### Install
### Install
## FAQ & Notes
```bash
# not a heading
```
## Using C#
produces:
- [Getting Started](#getting-started)
- [Install](#install)
- [Install](#install-1)
- [FAQ & Notes](#faq-notes)
- [Using C](#using-c)
Three details show up here. The second Install gets a -1 suffix. The comment inside the code fence is ignored. And the trailing # in C# is removed as if it were a closing marker, so the label needs correcting by hand.
With Numbered set to Yes:
1. [Getting Started](#getting-started)
1.1. [Install](#install)
1.2. [Install](#install-1)
2. [FAQ & Notes](#faq-notes)
3. [Using C](#using-c)
Where links may not line up
- The GitLab option currently matches GitHub. Both use the same anchor function, so switching between them changes nothing.
- A symbol between words differs from GitHub.
FAQ & Notesgets#faq-noteshere, but GitHub generates#faq--notes, so that link will not jump. Fix those by hand. - Non-ASCII letters are removed.
Café menugives#caf-menu, and a heading entirely in Japanese gives an empty#. GitHub keeps those letters. - Numbered output does not nest on most renderers.
1.1.is not valid list syntax in CommonMark, so sub-items run into the parent line. Use bullets if the list has more than one level. - A heading containing a link makes a broken nested link:
[[Docs](http://x.io)](#docshttpxio). - A suffix can collide with a real heading. Install, Install, Install 1 yields
#install-1twice. - Numbering a list that starts deep shows a zero, such as
0.1., when an H3 comes before the first H2. - Only
#headings at the start of a line count. Underlined headings,#NoSpaceand indented headings are skipped. - Only backtick fences are recognised. Hash lines inside a
~~~block are read as headings, and so are#comments in YAML front matter when their level is within your depth range. - A min depth above the max depth gives an empty result with no error.
Plain is the option for places without anchors, like chat or email: it outputs the indented bullet list with no links. To preview the finished document, use the Markdown editor, but note that its headings have no anchors, so links will not jump there. For tables, see the Markdown table generator. For anchor text on its own, the slug generator may be a better match.
Keeping a TOC accurate
How do I update the list after editing the document?
Paste the new version and copy the output over the old block. The list has no markers to update itself in place, so this is a manual step each time.
Should the H1 be in the list?
Usually not, since a README's single H1 is its title and is already at the top. Set Min depth to 1 if your document uses several H1 sections.
Do bold or code spans in a heading break the link?
No. The symbols are removed from the anchor while the label keeps its formatting: `foo()` bar links to #foo-bar.