Markdown Table of Contents Generator

Paste your markdown and get a clickable TOC with anchor links instantly.

How to Use

  1. Paste your markdown content with headings (## H2, ### H3, etc.)
  2. Click "Generate TOC" to create your table of contents
  3. Copy the generated markdown and paste it at the top of your document
  4. The links will work when rendered in any markdown viewer

Want to Share Your Markdown?

markshare turns your markdown into beautiful, shareable webpages with automatic TOC, syntax highlighting, and Mermaid diagrams.

Try markshare Free

Frequently Asked Questions

What is a Markdown Table of Contents?

A table of contents (TOC) in markdown is a list of links that point to different sections of your document. Each link uses an anchor that matches the heading's ID, allowing readers to jump directly to that section.

How are anchor links generated?

Anchor links are created by converting heading text to lowercase, replacing spaces with hyphens, and removing special characters. For example, "Getting Started" becomes "#getting-started".

Does this work with GitHub README files?

Yes! The generated TOC follows GitHub's anchor link format, so it works perfectly in GitHub README files, wikis, and issues.

What heading levels are included?

By default, we include H2-H6 headings. H1 is typically your document title and shouldn't be in the TOC. You can adjust this in the options.