Markdown TOC Generator
Generate a table of contents from any Markdown document with GitHub-, GitLab-, or Pandoc-style heading anchors. Configurable depth, live preview, runs entirely in your browser.
Loading tool...
What is Markdown TOC Generator?
Markdown TOC Generator extracts a navigable table of contents from any Markdown document. Paste a README, wiki page, or long-form doc and instantly get a list of anchor links compatible with GitHub, GitLab, or Pandoc. The parser understands ATX headings, setext headings, and ignores fenced code blocks — so only real headings make it into your TOC.
Key Benefits
- Matches GitHub, GitLab, and Pandoc slug conventions
- Configurable depth keeps the TOC concise
- Strips formatting inside headings automatically
- Works fully offline in your browser
Common Use Cases
- •Add a TOC to a long GitHub README
- •Generate navigation links for documentation sites
- •Build an outline for wiki or knowledge-base pages
- •Quickly audit heading structure of a Markdown file
How to Generate a Markdown TOC
- Paste Markdown: Paste your README, docs, or any Markdown content into the input box.
- Choose anchor style: Select GitHub, GitLab, or Pandoc to match your renderer.
- Set depth (optional): Limit headings to H1–H3 or any depth to keep the TOC concise.
- Copy or download: Copy the generated TOC as Markdown links or download it as a .md file.
Key Features
- GitHub, GitLab, and Pandoc anchor styles
- Configurable heading depth (H1–H6)
- Strips inline code, bold, italic, and links in headings
- Ignores headings inside fenced code blocks
- Unique slugs for duplicate headings
- Copy as Markdown or download as .md