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 is generated instantly 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?

The generator automatically creates URL-friendly slugs from heading text by converting to lowercase, removing special characters, and replacing spaces with hyphens. For example, "Getting Started Guide" becomes "#getting-started-guide". This follows standard Markdown linking conventions.

Can I control which heading levels are included?

Yes! Use the "Max Depth" selector to choose which heading levels to include. You can show only H1, H1-H2, H1-H3, or all headings up to H6. This is perfect for creating focused or comprehensive tables of contents.

Can I use bullet points or numbered lists?

Absolutely! Toggle between bullet list (-) and numbered list (1.) styles using the "List Style" option. Both formats maintain proper indentation for nested headings.

Does this work with GitHub-flavored Markdown?

Yes! The generated anchor links are compatible with GitHub, GitLab, Notion, and other CommonMark platforms. The links work seamlessly in README files, technical documentation, and wikis.

Can I generate a TOC for long documentation files?

Yes! The generator handles large documentation files efficiently. It scans all headings regardless of file size and generates a comprehensive table of contents with proper nesting and anchor links. Perfect for technical documentation projects.

Is the Markdown TOC generator free?

Yes, completely free with no limitations. Generate unlimited tables of contents with full customization options. No registration required.