Markdown Table of Contents Generator
GitHub-compatible anchors, including the -1 suffix for repeated headings. ATX and setext headings both count; headings inside fenced code blocks do not.
11 headings
Markdown Table of Contents Generator — Free Online Tool
Builds a nested table of contents from Markdown headings, generating GitHub-compatible anchor slugs (lowercased, punctuation stripped, spaces to hyphens, duplicates suffixed), supporting both ATX and setext headings, skipping headings inside fenced code blocks, and letting you choose the depth range and list marker.
How to use the Markdown Table of Contents Generator
- Open the tool above — it runs entirely in your browser, so your input never leaves this page.
- Paste or type your input into the field, then press the relevant button (e.g. Encode / Decode, Generate, or Convert).
- Copy the result from the output area with the copy button orCtrl/Cmd + C.
- No signup, no upload, and no tracking — repeat as often as you need.
Frequently asked questions
Will the anchor links actually work on GitHub?
Yes. The slugs follow GitHub's algorithm — lowercase, punctuation stripped, spaces to hyphens — including the -1, -2 suffix that disambiguates repeated headings, which is the detail most hand-written TOCs get wrong.
Why is my heading missing from the output?
Either it falls outside the level range, or it is inside a fenced code block. A line starting with ## inside a ``` block is a shell comment, not a heading, so it is deliberately skipped.
Does it handle emoji and non-English headings?
Non-English text is kept — the slug rule preserves Unicode letters and numbers, so Korean, Japanese and accented headings anchor correctly. Emoji are stripped, matching GitHub's own behaviour.
Free & private — why use this Markdown Table of Contents Generator
The Markdown Table of Contents Generator runs 100% client-side in your browser. Your data is never uploaded to a server, no account is required, and the tool is completely free. It works offline once the page has loaded and is part of a growing collection of privacy-first developer utilities.