TOC Generator
Paste Markdown, get a linked, nested table of contents. GitHub-compatible anchors, adjustable depth — copy and drop at the top of your doc.
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Requirements](#requirements)
- [Downloading](#downloading)
- [Configuration](#configuration)
- [Advanced Usage](#advanced-usage)
- [Performance Tuning](#performance-tuning)
- [Troubleshooting](#troubleshooting)Slugs follow GitHub’s algorithm, so anchor links work inside READMEs, GitHub issues, and most static site generators. Headings inside fenced code blocks are ignored.
About this tool
The Markdown TOC Generator scans your document's H1–H6 headings and produces a nested table of contents with anchor links, ready to paste at the top of any long Markdown file. It uses GitHub-compatible slug rules (lowercase, spaces to hyphens, special characters stripped) so the links work the moment you commit.
You control which heading levels appear. For a typical blog post, H2 and H3 give a useful but not overwhelming outline; for reference docs, go up to H4 or H5. The tool ignores headings inside fenced code blocks so pseudo-headings in code samples don't pollute your TOC.
As with every mdkit tool, everything runs in your browser. Paste proprietary docs without worrying about upload — your content stays on your device.
How it works
- 1
Paste your Markdown
Paste the full Markdown document — or just the heading structure — into the input field.
- 2
Set the heading depth
Choose the minimum and maximum heading levels to include. Default is H2–H3, which works for most blog posts and READMEs.
- 3
Copy the TOC
The generated Markdown TOC appears on the right. Click copy and paste it at the top of your document, usually right after the title and summary.
Common use cases
- Adding a navigation outline to the top of a long README
- Generating an anchor-linked outline for docs site pages before committing
- Building a TOC for a technical blog post that readers will skim
- Producing a summary of a research document's structure for a collaborator
- Quickly auditing the heading hierarchy of a doc — spotting skipped or duplicated headings
Frequently Asked Questions
Does this use GitHub-compatible anchor slugs?+
Can I include all heading levels (H1–H6)?+
Will it pick up headings inside code blocks?+
Does it handle duplicate heading text?+
Can I regenerate the TOC when I update the document?+
Related tools
Markdown → HTML
Instantly convert Markdown text to clean, semantic HTML code. Perfect for bloggers and developers who need to transform documentation into web-ready HTML.
Table Generator
Build GitHub Flavored Markdown tables with a live grid editor. Set column alignment, add or remove rows and columns, and copy clean Markdown — no memorizing pipe syntax.
Learn more
How to Write a Great GitHub README (With Template)
A complete guide to writing a README that gets stars, attracts contributors, and onboards users in seconds. Structure, tone, badges, screenshots, and a copy-paste template.
The Complete Markdown Cheat Sheet (2026)
Every Markdown syntax you'll ever need, in one reference: headings, lists, tables, code blocks, links, images, task lists, and GitHub extensions. Print-friendly and bookmark-ready.
Using Markdown for Technical Writing
Why Markdown is the default format for technical writing in 2026, how to structure docs, and the patterns that keep large docs maintainable over time.