Markdown TOC Generator
Paste your Markdown and get a linked table of contents with GitHub-compatible anchors instantly.
What is a Markdown TOC Generator?
A table of contents (TOC) is a list of linked headings at the top of a document that lets readers jump to any section. In Markdown, a TOC is built from a nested list of links pointing to heading anchors โ for example, - [Introduction](#introduction). On GitHub, GitLab, and most Markdown renderers these links navigate directly to the corresponding heading.
Building a TOC by hand is tedious, especially as your document grows. This tool extracts all headings from your Markdown, generates the correct anchor slugs (matching GitHub's algorithm: lowercase, spaces to hyphens, special characters stripped), and outputs a ready-to-paste nested list. You can filter by heading depth, switch between bullet and numbered lists, and use Insert into doc to place the TOC directly after the first H1 in your document.
How to Use
- Paste your Markdown document into the left panel.
- The TOC appears instantly on the right. Use the Preview tab to see the interactive tree, or Markdown for the raw output to copy.
- Adjust Min / Max level to include only the heading depths you want.
- Toggle Numbered list for ordered numbering instead of bullets.
- Click โฟป Copy TOC to copy the Markdown TOC, or โฉ Insert into doc to inject it into your document automatically.
Frequently Asked Questions
## Getting Started (v2) becomes #getting-started-v2. If the same slug appears more than once, a counter suffix is added: #getting-started, #getting-started-1, #getting-started-2, etc. This tool implements that algorithm exactly.
<!-- TOC --> โฆ <!-- /TOC --> block is replaced. The result appears in the input panel so you can copy the full updated document.