Markdown table of contents generation

Parse Markdown headings and generate a table of contents, excluding code blocks and handling duplicate headings, Setext headings, and level warnings.

Local browser processing
This page has passed the public directory check; full functionality is available after enabling JavaScript.
User Guide

How to use Markdown table of contents generation

The Markdown table of contents generator processes input only in the current browser; it does not upload data, connect to the internet, or write to persistent storage.

  1. Enter Markdown

    By default, loads examples featuring Batch 18 headings, code blocks, and duplicate headings.

  2. Generate table of contents

    View heading levels, slugs, duplicate-heading suffixes, and hierarchy-jump warnings.

  3. Copy result

    Copy the Markdown table of contents; input HTML and scripts are not executed.

Limitations and Notes

  • Only planned Markdown heading syntax is checked; HTML is not rendered, and templates are not executed.
  • Duplicate headings automatically receive suffixes, which may differ from anchors already used by third-party sites.
  • Headings and text size are subject to limits; complex extended syntax requires manual review.

FAQ

Do headings in code blocks appear in the table of contents?

No, content in fenced code blocks is excluded.

How are duplicate headings distinguished?

The tool adds a deterministic suffix to subsequent headings with the same name.

Can it guarantee that platforms such as GitHub are completely consistent?

No. Different renderers may use different slug rules.

Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback