Markdown TOC Generator
Generate a nested table of contents from any Markdown document's headings.
Quick answer: Markdown TOC Generator: generate a nested table of contents from any Markdown document's headings. Runs entirely in your browser, free, no signup.
Last updated
Good to know
The whole value of a generated table of contents is that its anchor links match the slugs your renderer will actually create. This tool follows GitHub's slugging rules: lowercase the heading, strip punctuation, and replace spaces with hyphens — so ## Getting Started becomes #getting-started. That compatibility is why the links work in a README without any manual anchor tags.
Nesting mirrors your heading levels, so a clean, sequential outline (H1 → H2 → H3, no skipped levels) produces a clean, indented list. If your document jumps from H2 straight to H4, the TOC faithfully reproduces that gap — which is a good prompt to fix the underlying structure rather than the list.
One edge case to watch: duplicate heading text. GitHub disambiguates repeated headings by appending -1, -2 and so on to the later slugs, but a standalone generator can only emit the base slug. If your document has two sections named "Overview," adjust the second link by hand so it doesn't jump to the first.
Regenerate the TOC whenever you add, rename or reorder sections — a stale contents list with dead anchors is worse than none. If you're still drafting, the live split-pane Markdown Editor is a faster place to shape headings before you finalize the outline here.
Frequently asked questions
- Is the TOC generator free?
- Yes — free with no signup.
- Are slugs GitHub-compatible?
- Yes — we use GitHub's lower-case + dash slugging so the anchor links work in your README.
- Are my docs uploaded?
- No — generation runs in your browser.
- Will it skip the H1?
- No — every heading level is included. Delete the H1 line manually if you don't want it in the TOC.
- What if two headings have the same text?
- GitHub appends -1, -2, … to disambiguate. This tool currently emits the base slug — manually adjust if needed.