Free online tools

Markdown Table of Contents Generator

Paste a README, guide or notes document to generate a linked contents list. Set the maximum heading level and choose a flat or nested layout.

Enter your values

Up to 30,000 UTF-16 units. Finds ATX and Setext headings with up to three leading spaces.

This tool processes your input in your browser.

Result

Collect headings and form section links

Use hash headings such as ## Quick setup, or a Setext heading consisting of text followed by an equals or hyphen underline. Heading links use GitHub-style fragments such as #quick-setup. The heading text is used as the readable label.

Account for duplicate section names

If Quick setup appears twice, the second uses #quick-setup-1. Suffixes are assigned in document order before the heading depth is applied. Heading labels strip common inline markup and preserve the text in code spans and Markdown links.

Check the anchors in your Markdown renderer

The scanner reads Markdown headings with up to three leading spaces. It skips fenced code, indented code, block quotes and HTML comments. A lightly indented heading inside a list can appear. Preview the links where you publish, especially when using custom anchors or a different Markdown renderer.

Frequently asked questions

What happens when a lower level is skipped?

The nested list uses the nearest earlier heading with a higher rank. An H4 can be nested directly under an H2 without an empty H3 item.

Does a filtered heading still affect duplicate links?

Yes. The calculator assigns fragments in source order for all recognised headings, including those below your selected maximum level.

Can I use the result in a GitHub README?

Yes. The output is ordinary Markdown with GitHub-style fragments. Copy it into the document and check the rendered links, especially if the headings contain unusual formatting.