Table of Contents Generator

Turn a long article, documentation page, or README into a navigable table of contents. Paste HTML or Markdown, choose which heading levels to include, and generate a nested list of anchor links together with updated heading IDs when needed.

Live preview

What this generator does

How to use

  1. Paste the document or relevant content.
  2. Choose input format or leave Auto Detect enabled.
  3. Select the heading range, usually H2–H4 for articles.
  4. Choose HTML or Markdown output.
  5. Review the preview and duplicate-heading suffixes.
  6. Copy the TOC and, for raw HTML, copy the updated heading markup if IDs were added.

Best practices

Frequently asked questions

Does the generator change my content?

Only when you choose the Updated HTML output. Existing valid IDs are preserved; missing IDs are added so generated links have targets.

How are duplicate headings handled?

The first heading receives the base slug and later duplicates receive numeric suffixes, such as setup and setup-2.

Can I generate Markdown?

Yes. The tool can create a nested Markdown list with anchor links as well as HTML.

Related tools & guides