DataToolsLab
Markdown Tools

Markdown TOC Generator

Generate a nested Table of Contents from your headings.

Loading tool…

What is MD TOC?

A TOC generator that scans a Markdown document's headings and produces a nested list of links, ready to paste at the top of the file.

How it works

Headings are parsed and slugified using GitHub's exact algorithm, including -1/-2 suffixes for duplicates, then linked in a nested list.

  1. Enter your input. Type or paste your input into the field above — the tool responds instantly.
  2. Review the result. Output updates live as you type. Everything runs entirely in your browser.
  3. Copy or download. Use the Copy button to grab the result, or Download to save it as a file.

Examples

Document navigation

Generate a table of contents from a document's headings — nested by level or flat — and paste it at the top.

Common mistakes

Anchor slug mismatches

The generated links use the same slugging rules as GitHub — changing a heading later breaks the anchor.

Frequently asked questions

Which heading levels are included?

H1–H6 are scanned; you choose the depth range and whether to nest by level.

Does it skip the H1?

An option excludes the document title (first H1) from the TOC.

Online