Markdown TOC Generator
Build a table of contents from Markdown headings
What is Markdown TOC Generator?
A Markdown table of contents generator extracts the headings within the levels you choose and emits a nested list of anchor links, as either a bulleted or a numbered list. Hash characters inside fenced code blocks are ignored, so shell and Python comments never leak into the outline. Generation happens locally in your browser.
How to use Markdown TOC Generator
- 1Paste your Markdown document.
- 2Set the shallowest and deepest heading levels — starting at H2 is the usual choice.
- 3Paste the generated list at the top of your document.
Frequently asked questions
Why do some of the anchor links not jump anywhere?+
Every platform slugifies headings a little differently. GitHub lowercases the text, replaces spaces with hyphens, and drops punctuation, while some static site generators append a numeric suffix on top of that. This tool follows the GitHub rules, so verify the links once if you publish somewhere else.
Will a # inside a code block be mistaken for a heading?+
No. Fenced code blocks are stripped out before headings are extracted, so hash characters in shell or Python comments never end up in the table of contents.
Related tools
All toolsText Diff Checker
Compare two blocks of text line by line, optionally ignoring whitespace
JSON Diff
Compare two JSON documents structurally, by key path
Regex Tester
Test regex matches live and inspect every capture group
Case Converter
Convert identifiers between camelCase, snake_case, kebab-case, and more
Word Counter
Count words, characters, lines, and estimated reading time
AI Token Counter
Count AI tokens and estimate what a call will cost