Loading Markdown TOC Generator...

How to Generate Markdown Table of Contents

Input

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:

•
Paste directly: Copy your markdown document and paste it into the input editor
•
Upload a file: Click "Upload" to select a .md or .markdown file from your computer
•
Try the sample: Click "Sample" to load example markdown and see how it works

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.
Options

Customize Your TOC

Configure how your table of contents is generated with powerful customization options. Perfect for GitHub README files, documentation, and wikis:

•
Max Depth: Choose which heading levels to include (H1 only, H1-H2, H1-H3, etc.)
•
List Style: Select bullet list (-) or numbered list (1.) format
•
Auto-indent: Nested headings are automatically indented for clear hierarchy
Output

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:

•
Copy to clipboard: One-click copying to paste into your markdown file
•
Download as file: Save as a .md file for later use
•
Anchor links: All entries link to their corresponding headings using slugified anchors

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.