Markdown Table of Contents Generator

Reads the headings in a Markdown document and builds a table of contents with links to each section. It is useful for long README files, guides and documentation, where readers want to jump straight to the part they need.

Up to 1 MiB.

Options

How to use the Markdown Table of Contents Generator

  1. Paste a Markdown document.
  2. Choose the heading levels to include and the list style. The table of contents appears as you type.

Rules applied

  • Anchors follow the GitHub convention: lowercase, punctuation removed, spaces become hyphens, and repeated headings get -1, -2 and so on.
  • Headings inside code blocks are ignored. Both # headings and underlined headings are found.

Limitations

  • Other sites (GitLab, static site generators) may create anchors slightly differently, especially for non-English text.

Worked examples

Document with repeated headings

Input

# Project
## Install
### Windows
### macOS
## Usage
## FAQ & Help
## Usage

Result

- [Install](#install)
  - [Windows](#windows)
  - [macOS](#macos)
- [Usage](#usage)
- [FAQ & Help](#faq--help)
- [Usage](#usage-1)
Numbered, levels 1 to 2

Input

# Intro
## Why
## How
# Details
## Notes

Result

1. [Intro](#intro)
   1. [Why](#why)
   1. [How](#how)
1. [Details](#details)
   1. [Notes](#notes)

Practical uses

  • Adding a contents list to a README

    A developer finishes a long README and wants readers to find sections quickly. They paste the document and the tool builds a linked table of contents from the headings. They then paste it below the title.

  • Choosing which heading levels appear

    A technical writer wants the contents list to stay short. They include only the first two heading levels and choose a numbered list. The result is a compact outline that does not list every small subheading.

  • Handling repeated headings

    A documentation author has several sections called Usage. The tool adds numbered suffixes to the links, following the GitHub convention. Each entry then points to the right section instead of always jumping to the first one.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.