Markdown TOC Generator

Paste your Markdown and instantly generate a linked table of contents. Supports GitHub-style anchors, nested indentation, and level ranges.

Last updated: 2026/10/16 Developer Feedback & bug reports
Markdown Input
Table of Contents
Headings: 0
Your table of contents will appear here.

How to Use

1

Paste Markdown

Paste Markdown containing headings (# to ######) into the input field. "#" inside code blocks is automatically ignored.

2

Adjust Options

Choose the heading level range, bullet or ordered list, and whether to include anchor links.

3

Copy the TOC

Copy the generated table of contents with one click and paste it at the top of your README or document.

About the Markdown TOC Generator

A web tool that parses Markdown headings and automatically builds a table of contents (TOC). It generates GitHub/GitLab-style anchors (slugs), so the TOC works as in-page links the moment you paste it into your README.md. All processing happens in your browser and your text is never sent to any server.

Features

  • GitHub-style AnchorsGenerates GitHub/GitLab-compatible slugs, handling non-ASCII headings and duplicates (-1, -2).
  • Level Range & NestingPick which heading levels (H1-H6) to include and let the TOC indent automatically by depth.
  • Code Block AwareIgnores "#" inside fenced code blocks (``` or ~~~) so comments are never mistaken for headings.
  • Privacy FirstAll processing happens in your browser. Your text is never sent to any server.

Use Cases

  • Add a table of contents to a GitHub / GitLab README.md
  • Build a TOC for technical blogs and documentation
  • Check the structure of Markdown articles
  • Extract an outline (heading list) from long Markdown
  • Generate navigation for wikis and internal docs

FAQ

Do the anchor links work on GitHub?
Yes. The tool uses a GitHub/GitLab-compatible slug algorithm, so pasting the TOC into your README.md gives you working in-page links. Note that anchor rules can vary slightly between platforms.
Are non-ASCII (e.g. Japanese) headings supported?
Yes. Headings with non-ASCII characters are turned into anchors too. Spaces become hyphens and punctuation is removed.
What happens with duplicate heading names?
Just like GitHub, the second and later occurrences get a numeric suffix (-1, -2, ...) appended to their anchor to keep them unique.
Are "#" characters inside code blocks treated as headings?
No. Lines inside fenced code blocks (``` or ~~~) are excluded from parsing, so a "#" comment is never mistaken for a heading.
Is my text sent to a server?
No. Everything runs in your browser via JavaScript. Your input is never sent to or stored on any server.
Can I change which heading levels are included?
Yes. You can set a minimum and a maximum level. For example, you can exclude the H1 title and include only H2-H4 in the TOC.