Markdown TOC Generator — Table of Contents

Build a linked Markdown table of contents from ATX headings (#). Choose GitHub, GitLab or Pandoc slug styles, plus depth and list options. Fenced code is ignored.

Loading…
Markdown TOC generator
Builds a table of contents from the ATX headings of a Markdown document, with GitHub, GitLab or Pandoc anchors.

Developer notes

This version accepts pasted text only, with no file selection or drop. The limit is 64 KiB of UTF-8 text. Only ATX headings (# Title) are read. Setext headings are not supported. Duplicate anchors get a small warning badge in the Rendered view. Switch to Raw Markdown to copy the TOC source.

Options

Anchor slug style
How anchor links are built: GitHub, GitLab or Pandoc rules.
Heading depth range
The first and last heading levels that appear in the table of contents.
TOC list marker
Marker of each entry: dash, asterisk, plus or ordered numbers.
Include first H1
Adds the first H1 heading to the table of contents. It is left out by default.

Use cases

Add a table of contents to a README or a documentation page. Match the anchors of GitHub, GitLab or Pandoc. Pair it with the other Text & Markdown tools of the hub.

Examples

Table of contents of a README

Before

# FastMinify Text & Markdown Tools Browser-local utilities for writers and developers working with READMEs, docs, and changelogs. ## Getting started Paste a Markdown document, choose a slug style (GitHub, GitLab, or Pandoc), and copy the generated table of contents. ### Options at a glance - **Slug style**: how anchor links are formed - **Depth range**: which heading levels appear in the TOC - **List style**: dash, asterisk, plus, or ordered markers ## Usage notes Headings inside fenced code blocks are ignored by design: ```markdown ## This line is not parsed as a heading ``` ## Advanced topics ### Duplicate titles Two headings that collapse to the same slug get `-1`, `-2` suffixes (GitHub-style). ### Inline **Markdown** in headings Bold and `code` markers are stripped from TOC labels. ## Slug style demo ### my_variable ### 2024 release ## Related tools See the Text hub for word count, line dedupe, and Markdown formatters.

After

- [Getting started](#getting-started) - [Options at a glance](#options-at-a-glance) - [Usage notes](#usage-notes) - [Advanced topics](#advanced-topics) - [Duplicate titles](#duplicate-titles) - [Inline Markdown in headings](#inline-markdown-in-headings) - [Slug style demo](#slug-style-demo) - [my_variable](#my_variable) …

Formatting inside a heading

Before

## **Bold heading**

After

- [Bold heading](#bold-heading)

Related tools

Part of the text tools hub. See also beautify-markdown.

Markdown TOC generator FAQ

Privacy and limits

Is my text uploaded?

No. Everything runs locally in your browser.

What is the size limit?

64 KiB of UTF-8 text per input.

Count words, build Markdown TOCs, and clean line lists — all in your browser.