TOC & Anchor GeneratorGitHub-Compatible Anchors

Markdown Table of Contents Generator

Automatically generate clickable, GitHub-compliant Markdown tables of contents from your document headings with customizable depth and list styles.

Max Depth:
Style:
Markdown Document
9 headings matched filter31 lines
Generated Table of Contents
Clickable anchor links for GitHub READMEs9 entries
Complete Guide & Overview

Generate Clickable GitHub Markdown Table of Contents Online

Quickly generate a clickable table of contents for your GitHub READMEs, open source documentation, and blogs. Automatically calculates URL-safe anchors compliant with GitHub, GitLab, and Bitbucket slug algorithms.

How to Use the Markdown TOC Generator

1

Paste Your Markdown Document

Input your README, documentation file, or blog article into the left panel.

2

Customize Depth & Style

Select your desired maximum depth (e.g. H2-H3) and preferred bullet or numbered layout.

3

Copy or Download

Copy just the TOC snippet to paste into an existing file, or download the full document.

Key Features & Capabilities

GitHub Slug Compliance: Generates standard anchors like #1-getting-started that link directly to headings.
Depth Filtering: Choose whether to include only H2, up to H3, H4, or all heading levels.
List Style Options: Toggle between unordered bullet points (-) and clean numbered hierarchies (1.).
Duplicate Anchor Handling: Automatically appends -1, -2 for headings with identical names.
1-Click Document Assembly: Download the complete document with the TOC pre-injected at the top.

Pro Tips & Best Practices

  • •Placing a clean TOC at the top of large README files dramatically improves readability and GitHub repository discovery.

Frequently Asked Questions

How do GitHub Markdown anchor links work?

GitHub turns each heading into a URL anchor by lowercasing the text, removing punctuation, and replacing spaces with hyphens (e.g. '## 1. Setup' becomes '#1-setup'). This generator follows that exact specification.

Does this ignore headings inside code blocks?

Yes! Comments like '# TODO' inside code snippets are recognized as code and excluded from the TOC.

Can I choose not to include the main H1 title?

Yes, the 'Include H1 Title' checkbox allows you to omit the top document title so your TOC focuses purely on sections.