Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Build a Markdown table of contents from document headings. Choose GitHub-safe anchors, heading levels, and a nested list you can paste into a README. Processing stays in your browser.
Use ATX headings such as ## Section. Headings inside fenced code blocks are ignored.
Minimum level
Maximum level
Slug style
Bullet
Indent
Output
Insert mode replaces [TOC] or <!-- toc -->, or places the list after the first H1.
Generate TOC
A Markdown TOC generator is a browser tool that reads ATX and setext headings in a Markdown document and writes a nested list of section links. Paste the source, set heading levels and a slug style, then copy the list or insert it at a [TOC] marker.
The parser follows CommonMark ATX heading rules: one to six # marks, then a space, then the heading text. TestMu AI maintains this tool so documentation and test plans stay easy to navigate. Pair the outline with a Markdown table generator when the same README also needs comparison tables.
A table of contents saves readers from scrolling a long README or test plan. An in-document list also travels with the file in Git, unlike a viewer-only outline. These are the main reasons teams add one:
The generator runs in your browser. Follow these steps to build a linked table of contents from your Markdown headings.
GitHub and GitLab both turn headings into fragment identifiers, but they do not treat punctuation and spaces the same way. Pick the matching slug style so pasted links land on the heading. GitHub basic writing syntax documents the GitHub rules used here.
| Rule | GitHub | GitLab |
|---|---|---|
| Case | Lowercase letters | Lowercase letters |
| Spaces | Each space becomes a hyphen, including runs left after punctuation is removed | Spaces become hyphens, then consecutive hyphens collapse to one |
| Punctuation | Removed, so Setup & Config becomes setup--config | Removed, then hyphens collapse, so Setup & Config becomes setup-config |
| Duplicates | Second match gets -1, then -2 | Second match gets -1, then -2 |
| Inline markup | Bold, italic, code, and links are stripped before the slug is built | Bold, italic, code, and links are stripped before the slug is built |
This Markdown TOC generator covers the heading and slug options that README and docs workflows need. Here are the features of the tool:
Teams use a Markdown TOC when a document is long enough that readers need jump links. These are common cases:
A Markdown table of contents is a nested list of links to headings in the same file. Paste the document into this generator, click Generate TOC, and copy the list under the title. Each item uses the [text](#slug) form so readers can jump to that section.
Yes. GitHub builds a heading anchor from each heading so a list item such as [Install](#install) jumps to that section. GitHub also adds a separate outline menu when a file has two or more headings. An in-document TOC still helps in long READMEs that readers clone or print.
Usually no. The first H1 is the document title, so repeating it in the TOC adds a link that only jumps to the top. This tool skips that first H1 by default. Turn the option off if your file uses H1 for real sections instead of a title.
GitHub lowercases the heading, strips punctuation, and turns spaces into hyphens. A second heading with the same text gets a -1 suffix, then -2, as documented in GitHub basic writing syntax. This generator applies the same suffix rule so both TOC entries land on the right section.
[TOC] is a placeholder some editors replace with a generated table of contents. This tool also honors an HTML comment marker. Choose Insert into document, then Generate TOC, and the list replaces that marker. If no marker is present, the list is placed after the first H1.
Yes. Set the minimum and maximum heading levels before you generate. A common README range is H2 through H3, which keeps the list short. Headings inside fenced code blocks are ignored, so sample markup in a fence does not create extra entries.
No. Heading parsing and slug creation run in your browser. The file is not sent to a server, except when you choose Load from URL, which fetches that URL from your browser. Clear the input when you finish if the document is private.
The slug is derived from the heading text. Rename a heading and the old fragment no longer matches, so the link goes nowhere. Generate the TOC again after heading edits. Duplicate headings also change suffixes when you reorder them, so regenerate after you move sections.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance