Markdown TOC Generator
Build a nested Markdown table of contents with GitHub-compatible anchor links from H1–H6 headings.
Related text tools
All Text toolsMarkdown Editor
Write Markdown with a live sanitized HTML preview and export to Markdown or clean HTML.
Markdown to HTML Converter
Convert GitHub Flavored Markdown into sanitized HTML snippets or complete styled HTML documents locally.
Markdown Link & Image Extractor
Extract inline links, reference links, autolinks, and images from Markdown documents with CSV export.
Markdown Formatter
Beautify Markdown by normalizing heading spacing, list bullets, ordered numbering, blank lines, and GFM tables.
About Markdown TOC Generator
Generate an indented Markdown Table of Contents with GitHub-compatible anchor links from any README or technical document while ignoring fenced code blocks.
How to use Markdown TOC Generator
- 1
Paste your Markdown document containing # through ###### headings.
- 2
Set minimum and maximum heading depth (for example H2 to H4), list bullet style, and anchor link formatting.
- 3
Copy just the generated Table of Contents or download the complete .md file with the TOC inserted at the top.
Frequently asked questions
Does it ignore # comments inside fenced code blocks?
Yes. Lines inside triple-backtick code fences are skipped so Python or shell comments are never mistaken for headings.
How are duplicate heading names handled in anchor links?
Following GitHub’s anchor convention, repeated headings automatically receive incremental suffixes such as #examples, #examples-1, and #examples-2.
Can I generate a plain outline without anchor links?
Yes. Uncheck GitHub anchor links to output a clean nested list of heading titles only.
