Markdown Tools

Markdown Table of Contents Generator

Auto-generate Table of Contents TOC from Markdown headings. Support for links, nested levels, custom depth, and slug generation.

markdowntoctable of contentsgenerator

Markdown Input

Table of Contents

What is Markdown Table of Contents Generator?

Markdown Table of Contents Generator scans a Markdown document and automatically builds a nested hyperlinked Table of Contents TOC based on the heading hierarchy h1 through h6. Long-form technical documentation README files books tutorial articles and API reference guides benefit enormously from a TOC that lets readers navigate directly to sections of interest. However manually maintaining TOC links as headings are renamed reordered or removed is error-prone and repetitive one heading change breaks multiple links. This generator parses the heading structure generates GitHub GitLab-compatible anchor slugs lowercased spaces-to-dashes special characters stripped produces a nested bullet list with correct indentation reflecting heading depth supports configurable maximum TOC depth to prevent overly deep nested links and can optionally add unique numeric suffixes when duplicate heading slugs would collide as GitHub does. Optionally wrap the TOC in details summary collapsible HTML tags for embedding at the top of long Markdown files without taking up excessive vertical space. Regenerate the TOC with a single click any time the document changes.

When to Use Markdown Table of Contents Generator

Use when authoring long technical documentation, maintaining README files with multiple sections, creating tutorial or course outlines, organizing API reference docs, or building Markdown-based books.

How to Use Markdown Table of Contents Generator

Paste a complete Markdown document. Configure TOC depth h2-h4 recommended. Toggle ordered vs unordered list, wrap in details tags, and duplicate suffix handling. Copy the generated TOC to paste at the top of your document.