How it Works
The Markdown TOC Generator analyses your source Markdown code to extract Heading tags (e.g.
#, ##) and build a navigation tree.
1. Parsing Headings
The tool uses a tokenizer to scan the text, ignoring
# symbols inside code blocks to accurately identify the document structure.
2. Generating Anchors (Slugs)
It generates anchor links following the GitHub Flavored
Markdown (GFM) standard. For example, "Hello World!" becomes #hello-world.
3. Building the Tree
Based on the heading levels (H1-H6), it automatically creates an indented list, forming a clean Table of Contents.
Use Cases
GitHub README
Generate a professional navigation table for your open-source project's README.md, helping users find content quickly.
Tech Blogging
Insert generated TOC directly into Hugo, Hexo, or Jekyll blog posts to improve readability for long articles.
API Documentation
Organize complex API documentation by generating a clear index of endpoints and sections.
Freqently Asked Questions
Does it support GitHub style anchors?
How does it handle '#' in code blocks?
# symbols inside code blocks.
Can I generate numbered lists?
Are non-English headings supported?
Can I insert this directly into my MD file?
Do all Markdown editors support this?
[TOC] syntax, but the output from this tool is
standard Markdown list syntax, which is compatible with 100% of Markdown viewers.
How are duplicate headings handled?
Is my data sent to a server?
More Free Tools
Markdown Editor
Free online Markdown editor with real-time preview. One-click HTML export. Writing made simple.
Markdown Table Generator
Visual editor & Excel/CSV to Markdown converter. Instant preview, alignment controls, copy to clipboard.
HTML ↔ Markdown
Bidirectional conversion between HTML and Markdown. Real-time preview and clean formatting.
Word Counter
Count words, characters, and paragraphs in real-time. Estimate reading time.
Text Cleaner
Remove empty lines, duplicate lines, and extract emails/URLs.
Case Converter
Convert text between Uppercase, Lowercase, CamelCase, Snake Case, etc.