Markdown TOC & Heading Extractor
About Markdown TOC Generator
The Markdown Table of Contents (TOC) Generator creates clickable, indented Markdown and HTML navigation lists with automated slug generation for GitHub READMEs, GitLab wikis, and technical blog posts.
How to Use Markdown TOC Generator
Step 1
Paste your Markdown document into the input pane.
Step 2
Select heading depth range (e.g. H2 to H4) and slug style (GitHub default).
Step 3
Review the generated Table of Contents.
Step 4
Click "Copy Table of Contents".
Practical Use Cases for Markdown TOC Generator
Adding a Table of Contents to GitHub `README.md`
Generate an indented, clickable table of contents for long open-source README files with GitHub-compatible anchor slugs.
Generating Sidebar Navigation for Static Sites
Generate Markdown or HTML nested list TOCs for Astro, Docusaurus, Nextra, and Hugo documentation pages.
Input & Output Examples
Generating Clickable Table of Contents
`# Guide\n## Getting Started\n### Prerequisites\n## Deployment`
`## Table of Contents\n- [Getting Started](#getting-started)\n - [Prerequisites](#prerequisites)\n- [Deployment](#deployment)`
Key Features & Performance
- ✓Configurable heading depth (e.g. include only H2-H3, ignore H1).
- ✓Slug formats: GitHub, GitLab, Bitbucket, Ghost, or Dev.to anchor conventions.
- ✓Output formats: Markdown list (`- [Title](#slug)`), Numbered list (`1.`), or HTML `<nav>`.
- ✓100% Client-Side memory execution.
- ✓1-Click Copy or Insert TOC at cursor.
Key Terminology & Definitions
Table of Contents (TOC)
A list of document sections placed at the beginning of a file, providing direct jump links to section headers.
Anchor Slugification
Converting heading strings to URL-friendly lowercase anchor identifiers by replacing spaces with hyphens and stripping punctuation.
