Markdown TOC generator

← All tools

Extract headings from markdown and build a linked TOC. Works like GitHub/GitLab README anchors. See also markdown table generator and markdown preview.

Generated TOC

Works on: GitHub, GitLab, most static site generators using GitHub slug rules.

May differ: Hugo, Docusaurus, and some CMSs use different anchor algorithms — test on your platform.

About this tool

Headings inside fenced code blocks are ignored. Anchors use GitHub slugification: lowercase, punctuation stripped, spaces to hyphens, duplicates get -1 -2 suffixes.

The extracted table lists every heading that survived the depth filter so you can spot typos or slug collisions before pasting the TOC into a README. Paste the output near the top of the same file — links only work when heading text and slug rules match your renderer. Hugo and Docusaurus often differ from GitHub.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →