Web Tools
Markdown TOC Generator
Generate a table of contents from Markdown headings. Supports configurable heading levels, ordered/unordered lists, GitHub-compatible anchor links, duplicate heading handling. Runs entirely in your browser — your data never leaves your machine.
markdown toc table-of-contents headings documentation
Published May 30, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste Markdown content and instantly generate a formatted table of contents. The tool extracts ATX-style headings, generates GitHub-compatible anchor links, and outputs a properly indented Markdown list.
Features
- Heading extraction: parses all ATX headings (# through ######)
- GitHub-compatible anchors: lowercase, spaces to hyphens, special chars stripped, duplicate suffixes (-1, -2)
- Level filtering: configurable minimum and maximum heading levels (e.g., H2-H4 only)
- List styles: unordered (bullet) or ordered (numbered) output
- Flat mode: optional flat list without indentation
- Code block awareness: skips headings inside fenced code blocks
- Inline Markdown stripping: removes bold, italic, code, links from heading text
- Statistics: heading count per level
- 5 examples: README structure, API docs, deep nesting, duplicate headings, mixed content
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Adding a table of contents to README files
- Generating navigation for long documentation pages
- Reviewing document structure at a glance
- Creating anchor links for Markdown-based wikis