Markdown TOC Generator

Build a table of contents from Markdown headings

Runs in your browserUtility05Text & Diff

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

  1. 1Paste your Markdown document.
  2. 2Set the shallowest and deepest heading levels — starting at H2 is the usual choice.
  3. 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 tools