Markdown TOC Generator
Generate a table of contents from Markdown headings. Supports configurable depth, ordered/unordered lists, and GitHub-compatible anchor links for README navigation.
🌈 Browse More Tools
Complete Guide: Markdown TOC Generator
Everything you need to know about using this tool effectively
The Markdown TOC Generator scans your document for headings and creates a nested table of contents with anchor links. It supports configurable heading depth, ordered or unordered list styles, and generates GitHub-compatible slug anchors. The output is a Markdown list you can paste at the top of your document. All processing happens in the browser.
This tool parses all headings in the Markdown input, determines their nesting level, and generates a Markdown list with relative anchor links. Each list item links to the corresponding heading using a URL-friendly slug derived from the heading text.
Adding navigation to READMEs
Generate a clickable table of contents for long GitHub README files.
Structuring documentation
Create a TOC for wiki pages and documentation sites.
Organizing blog posts
Add a table of contents to Markdown-based blog articles.
Preparing changelogs
Generate anchor links for changelog sections by version.
Paste Markdown with headings
Enter Markdown text containing headings in the input area.
Configure options
Set heading depth and list style preferences.
Generate
Click Generate. The tool creates the TOC.
Copy the TOC
Copy the table of contents and paste it into your document.
Start headings at h2 (##) for most READMEs. Reserve h1 for the title.
Use consistent heading text. Duplicate headings create ambiguous anchors.
GitHub auto-generates anchors from heading text with lowercase and hyphens.
Update the TOC after editing headings to keep anchors in sync.
What anchor format is used?
The tool generates GitHub-compatible slug anchors: lowercase text with spaces replaced by hyphens and special characters removed.
Is my content sent to a server?
No. All generation happens in your browser. Nothing is transmitted.
Can I limit the heading depth?
Yes. Configure the maximum heading level to include (for example, h2-h3 only).
Does it work with GitLab?
Yes. GitLab uses similar anchor slug conventions to GitHub.
Can I use ordered lists?
Yes. Choose between ordered (1. 2. 3.) and unordered (- - -) list styles.