Markdown TOC Generator
Paste a Markdown document; get a table of contents listing every heading with GitHub-compatible anchor links. Configure max depth and whether to include the document's H1.
How to use the Markdown TOC Generator
Paste Markdown. The generator finds # through ###### headings and produces a nested list. Anchor slugs follow GitHub's algorithm: lowercase, hyphens for spaces, strip punctuation. Drop the result into the top of your README.
A table of contents from your headings
A long Markdown document — a README, a wiki page, a spec — is far easier to navigate with a table of contents linking to each section. Building one by hand means copying every heading and working out the anchor link the platform will assign, then keeping it all in sync as the document changes.
This generator reads the headings from # through ###### and produces a nested list, with each entry linking to its section. The anchor slugs follow GitHub's rule — lowercase the text, replace spaces with hyphens, strip punctuation — so the links work when the file is viewed on GitHub. You control the maximum depth and whether the document's H1 is included.
Common use cases
- README navigation — add a clickable contents list to the top of a project README.
- Long documentation — give a multi-section page jump links to each heading.
- Wikis and specs — generate the contents block for a lengthy reference document.
- Controlling depth — include only H2s, or go down to H6, depending on how detailed the list should be.
- Numbered or bulleted — choose the list style that fits the document.