Markdown Table of Contents Generator
CodeScan a Markdown document's ATX headings and build a nested table of contents with GitHub-style anchor slugs, disambiguating duplicate headings automatically
Paste a Markdown document and get back a ready-to-paste table of contents: a nested bullet or numbered list of links pointing at GitHub-style anchor slugs for every heading in range. It reads only ATX-style headings (one to six hash marks), skips anything inside a fenced code block so a heading-shaped comment in a code sample never becomes an entry, and strips inline formatting like bold, code spans, and links from the heading text before slugifying it. Duplicate headings get the same -1, -2 suffix disambiguation GitHub's own renderer uses, so the anchors match what GitHub would actually generate for the same document.
How to use Markdown Table of Contents Generator
- 1.Paste a Markdown document, or try the sample doc to see the output shape.
- 2.Optionally switch to a numbered list if your documentation site expects ordered TOC entries.
- 3.Copy the generated table of contents and paste it near the top of your document.
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/markdown-toc-generator \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"markdown":"# Title\n\n## Section One\n\n## Section Two\n"}'Get an API key from your dashboard · Full API docs →