Runs in your browser

TOC Generator

Generate a table of contents with GitHub-compatible anchors.

Part of the Document Checker bot
Processed in your browser
Drop a .md file
Table of contents

About the Markdown TOC Generator

Generate a Markdown table of contents with links that work on GitHub. Choose heading levels and list style, and copy the TOC or your whole document with the table of contents inserted after the title.

How to generate a table of contents

  1. Paste your Markdown, or open or drop a .md file.
  2. Choose which heading levels to include and how the list should look.
  3. Copy the table of contents, or copy your whole document with the TOC inserted after the title.

Anchors that match GitHub

Links use the same heading IDs GitHub generates: lower-case, spaces become hyphens, punctuation is removed, and repeated headings get -1, -2 suffixes. The links work in READMEs, wikis and most Markdown renderers.

Ignores code blocks

Lines starting with # inside fenced code blocks are comments, not headings, so they are skipped.

Questions

Will the links work on GitHub?

Yes. Anchors follow GitHub's heading-ID rules, including duplicate headings.

Why is my main title not in the list?

By default the TOC starts at H2, because most documents have a single H1 title. Set the levels to start at H1 to include it.

Where does “Copy document with TOC” put the list?

Right after the first H1 title, or at the top if there is no H1. An existing TOC is not detected, so remove an old one first.

Is my document uploaded?

No. Everything runs in your browser.

Also searched as: markdown table of contents generator · readme table of contents · github toc generator · generate toc markdown · markdown toc