Markdown TOC Generator
Generate table of contents from headings
Paste Markdown headings first to generate a TOC immediately; anchor rules and nesting guidance are available in Advanced mode.
The full guide also includes pitfalls, worked examples, snippets, FAQs, and related tools for checking results or troubleshooting.
About this tool
Extract ATX headings marked with # through ###### into a Markdown link list. Choose whether to include H1, use a numbered list, or limit depth to H3. Chinese heading characters are retained in anchors, duplicate anchors get suffixes, and fenced code examples are skipped. The generated anchors use this tool’s rules; check them against the renderer where you publish.
Production Snippets
Repeated Chinese headings receive distinct anchors
text
## 安装
## 安装
- [安装](#安装)
- [安装](#安装-1)Frequently Asked Questions
Does it parse every Markdown heading style?
No. It reads ATX headings with up to three leading spaces and ignores backtick or tilde fenced code blocks. Setext underlined headings, HTML headings and full inline Markdown semantics are not parsed.
Are these exact GitHub or CMS anchors?
Not necessarily. Anchors are lowercased, retain letters/numbers/combining marks, remove other punctuation and join spaces/underscores with hyphens. Collisions receive numeric suffixes. Custom renderer IDs can differ.
Does the depth filter change heading IDs?
No. Anchors are assigned in document order before filtering. The list keeps indentation based on original heading levels. The input and options use a local browser draft, removable with Clear.
Keep browsing