490+ Tools Comprehensive Tools for Webmasters, Developers & Site Optimization

Markdown TOC Generator

Generate a table of contents from markdown headings.


About Markdown TOC

A Table of Contents (TOC) helps readers navigate long markdown documents. It automatically generates navigation links from your document's heading structure.

How It Works

The generator scans your markdown for headings (#, ##, ###, etc.) and creates a nested list with optional anchor links.

GitHub-Compatible Anchors

When enabled, the tool generates anchor links that work with GitHub's automatic heading ID system:

  • Converts text to lowercase
  • Replaces spaces with hyphens
  • Removes special characters
  • Creates URL-safe anchors

Example Input

# My Project
## Getting Started
### Installation
### Configuration
## Usage
### Basic Examples
### Advanced Features

Example Output

- [My Project](#my-project)
  - [Getting Started](#getting-started)
    - [Installation](#installation)
    - [Configuration](#configuration)
  - [Usage](#usage)
    - [Basic Examples](#basic-examples)
    - [Advanced Features](#advanced-features)

Best Practices

  • Use consistent heading hierarchy (don't skip levels)
  • Place TOC near the top of your document
  • Update TOC when adding or removing sections
  • Consider using H2-H3 for most documents (skip H1 if it's the title)
  • Keep heading text clear and descriptive

Platform Compatibility

  • GitHub/GitLab: Automatic anchor IDs work out of the box
  • Static Site Generators: Jekyll, Hugo, MkDocs support anchor links
  • Documentation Tools: Docusaurus, VuePress, Read the Docs
  • Markdown Editors: VS Code, Typora, Obsidian
Heading Levels

Markdown Syntax:

# H1
## H2
### H3
#### H4
##### H5
###### H6
Quick Tips
  • Use H1 for document title only
  • H2-H3 are most common in TOC
  • Too many levels reduce clarity
  • Keep heading text under 60 chars