Markdown TOC Generator

Runs in your browser Runs in your browser · Files stay on your device · 100% private

Build a clickable table of contents from Markdown headings.

Paste Markdown with headings to build a TOC.

Heading outline

Duplicate headings get a numbered anchor, the same way GitHub does it.

Input
Markdown text
Output
Markdown table of contents
Processing
In-browser
Retention
Stays on device

FAQ

What anchor format does this tool use?

It follows the GitHub heading format: lowercase text, punctuation removed, spaces replaced with hyphens, and Unicode letters preserved. The outline shows the exact anchor for every heading.

How are duplicate headings handled?

The first heading gets the plain anchor. The next one gets -1, then -2, and so on. The outline marks duplicate headings so you can spot them before copying.

Does it read headings inside code blocks?

No. Headings inside fenced code blocks and YAML front matter are ignored, so a code sample cannot add a fake entry to the list.

Does it support Setext headings?

This version reads ATX headings only, the kind written with #, ##, and so on. Setext headings written with underline characters are not included.

Can I make a numbered table of contents?

Yes. Switch the list style from bullets to numbers. Top-level headings count up across the document, and nested levels restart under each parent heading.

Is my Markdown uploaded anywhere?

No. Heading extraction and TOC generation run in your browser. The text stays on your device, and there is no account or server round trip.

What are the input limits?

The editor accepts up to 1 MB of Markdown and 5,000 headings. Larger input shows an error instead of producing a partial table of contents.

Can I insert the TOC into Markdown Preview?

Yes. The preview page has an Insert TOC button that uses the same anchors, so the links work in the preview and in the downloaded HTML.

More details & usage notes

A Markdown TOC generator turns a long README or documentation page into a list of links that readers can scan and click. This tool reads ATX headings, ignores anything inside fenced code blocks, and builds anchors with the same lowercase, hyphenated format GitHub uses. Duplicate headings get numbered anchors such as #usage-1, so every link still points to a real target. Paste your Markdown, choose how deep the list should go, then copy the result into your document.

How to use Markdown TOC Generator

  1. Paste your Markdown:

    Drop a README, a documentation draft, or any Markdown text into the editor. The outline updates as you type.

  2. Choose depth and style:

    Limit the list to two to six heading levels. Pick bullets for a compact list or numbers when order matters.

  3. Check the outline:

    The outline panel shows each heading level, the text that will appear, and the exact anchor. Duplicate headings are marked.

  4. Copy or download:

    Copy the TOC into your README, or download a .md file and merge it into your document.

Tips for Markdown TOC Generator

  • To see the generated TOC rendered with the rest of your document, open Markdown Preview.

  • To turn the same Markdown into a PDF with the TOC included, use Markdown to PDF.

  • Keep heading levels consistent. A jump from H2 to H4 still produces a usable list, but the outline is easier to read when levels move one step at a time.

  • Fenced code blocks are ignored, so example headings inside a code sample never appear in the TOC.

  • If two headings share the same text, keep both. The tool numbers the anchors so each link still has a unique target.

Common use cases

  • README navigation:

    Add a short table of contents to the top of a GitHub README so readers can jump to install, usage, and configuration sections.

  • Documentation handoff:

    Turn a long internal spec into a document with a clickable outline before sending it to another team.

  • Course notes and guides:

    Build a study index from lecture notes or a tutorial series without writing anchors by hand.

  • Release notes index:

    Give a long changelog a short list of links so readers can jump to the version or feature they need without scrolling through every entry.