Advertisement

Markdown Table of Contents Generator

Parse markdown documents and generate a clean, clickable Table of Contents (TOC) with GitHub-compliant anchor links in seconds.

Markdown Document

0 headings detected

Generated Table of Contents

TOC preview will appear here...

Why Add a Table of Contents to Markdown Documents?

Long documentation files, open-source GitHub README.md files, technical specifications, and wiki articles can quickly stretch across hundreds of lines of code.

Adding a structured Table of Contents (TOC) provides visitors with an instant overview of the project architecture and allows them to jump directly to installation instructions, configuration tables, or API references with a single click.


How GitHub Anchor Links Work

GitHub, GitLab, and most Markdown parsers (like CommonMark) automatically convert headings into anchor tags following strict slugification rules:

  • Lowercasing: All uppercase letters are converted to lowercase (# Getting Started becomes #getting-started).
  • Whitespace replacement: Spaces and tabs are replaced with hyphens (-).
  • Punctuation stripping: Colons, slashes, periods, exclamation marks, and question marks are completely removed.
  • Duplicate handling: Identical headings receive sequential numbering (e.g., #example, #example-1, #example-2).

Frequently Asked Questions (FAQ)

Yes! The generated anchors strictly follow GitHub's official slugification algorithm, ensuring that clicking any TOC item smoothly scrolls the user to the matching heading on GitHub and GitLab repositories.

The top-level # H1 heading typically represents the title of the repository or article itself. Including it in the Table of Contents creates redundant clutter because the reader is already at the top of the page.

Yes, 100% in-browser processing using JavaScript regex parsers. Your confidential project documentation and code are never uploaded to any external server.
AI Images