Markdown TOC Generator
Build a table of contents from your Markdown headings, with anchor links that match GitHub.
Loading Markdown TOC Generator...
How to Generate Markdown Table of Contents
Add Your Markdown Content
Start by adding your Markdown content that contains headings. The generator works with GitHub-flavored Markdown, standard Markdown, and other variants to automatically scan for all heading levels:
Example: Markdown with Headings
Here's what markdown with multiple heading levels looks like:
# Main Title Some introduction text. ## Getting Started Content about getting started. ### Installation How to install. ### Configuration How to configure. ## Usage Guide Usage instructions.
Customize Your TOC
Configure how your table of contents is generated with powerful customization options. Perfect for GitHub README files, documentation, and wikis:
Get Your Generated TOC
The table of contents appears as soon as you stop typing, with clickable anchor links following best practices for TOC design! You can:
Example: Generated Table of Contents
The generated TOC with clickable anchor links:
# Table of Contents
- [Main Title](#main-title)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage Guide](#usage-guide)Frequently Asked Questions
How does the Markdown TOC generator create anchor links?
It uses the same rule GitHub uses for heading anchors: the visible heading text is lowercased, punctuation and emoji are dropped, and each space becomes a hyphen. "Getting Started Guide" becomes #getting-started-guide, "Version 14.50" becomes #version-1450, and "José 😀" becomes #josé-. If two headings have the same text, the second one gets -1, the third -2, just like on GitHub.
Can I control which heading levels are included?
Yes. The "Max Depth" selector lets you keep only H1, H1-H2, H1-H3 and so on up to all six levels. Hidden headings still count towards duplicate numbering, so the anchors you do see stay correct.
Can I use bullet points or numbered lists?
Yes. Switch "List Style" between a bullet list (-) and a numbered list (1.). Nested headings are indented the right amount for each style, so sub-items really nest when the Markdown is rendered.
Which headings are picked up, and which are skipped?
Both # style and underlined (=== and ---) headings are read, and closing #s are ignored. Lines that only look like headings inside fenced or indented code blocks are left out. Bold, italics, inline code and links in a heading are reduced to their text in the TOC entry, and raw HTML tags in a heading are left out of both the text and the anchor.
Does this work with GitHub-flavored Markdown?
The anchors are made for GitHub, so they match what GitHub generates for README files and wiki pages. GitLab uses almost the same rule, but it merges repeated hyphens, so a heading like "A & B" may get a slightly different anchor there. Other sites with their own anchor rules may need small edits.
Is my Markdown uploaded anywhere?
No. The table of contents is built in your browser, and the text you paste or upload is not sent to a server. A file with a couple of thousand headings is handled without trouble.
Related Tools
Markdown to HTML
Convert Markdown documents to HTML with live preview and syntax support
HTML to Markdown
Convert HTML to Markdown format for documentation and content management
Markdown Fixer
Fix broken Markdown automatically, repair broken links, tables, and formatting errors
JSON to Markdown
Convert JSON data to Markdown tables, lists, or code blocks
Markdown to JSON
Parse Markdown tables and lists into structured JSON data
Markdown Editor
Write and preview Markdown in real-time with live preview