Turn your Markdown headings into a clean, nested table of contents with GitHub-style anchor links.
Scan any Markdown document and produce a clean, nested table of contents in real time as you type.
H2, H3 and deeper headings are indented automatically, so your outline mirrors the document structure exactly.
Every entry links to its section with the same #slug anchors GitHub generates, so links work in READMEs and gists.
Choose maximum heading depth, include or skip H1, and switch between bullet and numbered lists in one click.
Headings inside fenced or indented code blocks are ignored, so your TOC never lists code comments as sections.
Copy the TOC to the clipboard or download it as a .md file, ready to paste into any Markdown document.
The Markdown TOC Generator reads the headings in your Markdown document and turns them into a tidy, nested table of contents. It follows GitHub's anchor rules, skips headings that live inside code blocks, and lets you control depth and list style — so your README and documentation stay organized with zero manual formatting.
Generate a table of contents in three steps.
Drop your Markdown document into the input pane; the sample document already demonstrates nested headings.
Pick a maximum heading depth, decide whether to include H1, and choose bullets or numbers.
Grab the generated table of contents from the output pane, or save it as a .md file and paste it into your document.
The TOC uses GitHub-style anchors: lowercase text with spaces converted to hyphens, and duplicate headings get -1, -2 suffixes. Only ATX headings (# to ######) are detected — setext headings (=== and ---) and headings inside code blocks are ignored. The tool runs entirely in your browser; your document never leaves your device.