Markdown Table of Contents Generator

Paste a Markdown document, get a Table of Contents back. Markdown list with anchor links, nested HTML, or a plain outline. Live, in your browser.

Output style
Levels
Output
 
How the parser works
  • ATX headings (# Title###### Tiny) and setext headings (text under === or ---) are both picked up.
  • Headings inside ``` or ~~~ code fences are ignored.
  • Leading YAML frontmatter (between --- markers) is skipped.
  • Slugs follow the GitHub convention: lowercase, hyphens for spaces, punctuation dropped. Duplicates get a -1, -2 suffix.
  • HTML output escapes the heading text; markdown output escapes pipes (|) so the result is safe to drop inside another markdown table.