Markdown TOC
Markdown TOC — runs in your browser. Inputs are not stored.
Markdown TOC generator
Enter values, then press Calculate.
How to use
- Paste the body into the Markdown field. The document needs ATX headings (# title).
- Choose Minimum level and Maximum level. The default is H2 through H4.
- Click Generate TOC and an indented list with anchor links is created.
- Copy it onto the top of a README or wiki. You can clear the input with Reset.
- A # inside a code block is not distinguished, so if a comment-like heading mixes into the TOC, edit the body.
Key concepts
Markdown TOC is for quickly making table-of-contents links on a GitHub README, tech blog, or docs site. It finds # through ###### line by line and outputs only the chosen levels as - [title](#slug). The slug is lowercased with spaces turned into hyphens, and Hangul is kept. Repeated titles get -2, -3. It is a markdown TOC generator that builds GitHub README contents, wiki sidebars, and docs jump links from ATX headings only.
Underline Setext headings (===, ---) are not recognized. Anchor rules may not match GitHub or some static-site generators 100%, so if a click does not work in preview, check the renderer rules. Conversion happens only in the browser. With min and max levels you can omit H1 titles and include only H2–H4. A # inside a code fence can be mistaken for a heading.
Example
Put ## Install, ### Requirements, ## Usage in the body and generate with min H2 and max H4: Install and Usage share the same indent, and Requirements is one level in. Links are slugs that keep Hangul titles, such as #설치 and #요구-사항. If there is only H1 and the minimum is H2, the TOC can be empty. Put ## Getting started and ### Install and Install nests under Getting started, with links #시작하기 and #설치.
Related: Markdown preview · Markdown → HTML
Frequently asked questions
Do Setext headings (===) go into the markdown TOC too?
No. Only # style (ATX) is supported. Setext underline titles do not go into the TOC, so add #.
What happens to Hangul title anchor slugs?
Hangul is kept and spaces become hyphens. Renderers can differ. If Hangul anchors break on a static site, check the slug-plugin rules.
Are # comments inside code blocks caught in the TOC?
It is simple line parsing and does not distinguish code blocks. If a # TODO comment mixes into the TOC, remove it from the body.
Is it identical to a GitHub README TOC?
Similar, but special-character stripping and duplicate rules may not be a perfect match. GitHub special-character stripping can differ, so click-test in preview.
When do I use min and max heading levels?
Use the defaults when you omit the document title (H1) and put only H2–H4 in the TOC. To include from H1, change the minimum level to H1.
If the same title appears twice, do anchors collide?
From the second one, a number such as -2 is appended to the slug. The same title gets -2 on the second link to avoid a clash.
Last reviewed: 2026-09-04