Markdown TOC Generator

Turn your Markdown headings into a clean, nested table of contents with GitHub-style anchor links.

Features

Instant TOC generation

Scan any Markdown document and produce a clean, nested table of contents in real time as you type.

Nested heading tree

H2, H3 and deeper headings are indented automatically, so your outline mirrors the document structure exactly.

GitHub-style anchor links

Every entry links to its section with the same #slug anchors GitHub generates, so links work in READMEs and gists.

Flexible output options

Choose maximum heading depth, include or skip H1, and switch between bullet and numbered lists in one click.

Code-safe parsing

Headings inside fenced or indented code blocks are ignored, so your TOC never lists code comments as sections.

Copy and export

Copy the TOC to the clipboard or download it as a .md file, ready to paste into any Markdown document.

About this tool

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.

How to use

Generate a table of contents in three steps.

1

Paste or type your Markdown

Drop your Markdown document into the input pane; the sample document already demonstrates nested headings.

2

Adjust the options

Pick a maximum heading depth, decide whether to include H1, and choose bullets or numbers.

3

Copy or download the TOC

Grab the generated table of contents from the output pane, or save it as a .md file and paste it into your document.

Good to know

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.

Frequently asked questions