AI Document TOC Generator

Auto-generate a table of contents from any AI-generated document.

Scans an LLM document for headings in markdown, HTML, or section-numbered format and generates a nested table of contents with anchor links in your chosen output format, entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What heading formats are detected?

Markdown ATX headings (# to

Why generate a TOC

Long AI-generated documents — reports, guides, specs, research summaries — are much easier to navigate with a table of contents, but models rarely produce one that is correct and clickable. Doing it by hand means re-reading the whole thing and copying every heading. This tool scans the document, finds every heading, and builds a clean nested table of contents in the format you need.

The difference between the three output formats

Each format serves a different destination:

Markdown with anchor links produces a bulleted list where each heading is a [Title](#anchor) link. Use this when you want to paste the TOC at the top of a GitHub README, a Notion doc, or any markdown-rendered document. The anchors are slugified to match the auto-generated heading IDs on most markdown platforms (lowercased, spaces to hyphens, punctuation stripped).

HTML unordered list produces nested <ul><li><a href="#anchor"> markup. Use this when pasting into an HTML document, a CMS that accepts raw HTML, or a static site template where you control the markup directly.

Numbered plain-text outline produces a 1. / 1.1 / 1.2 hierarchical outline with no links. This is the most portable format — it works anywhere text is accepted — and it is useful for turning a draft heading structure into a planning outline you can share or annotate before actually writing the content.

How it works

The generator recognises three common heading styles that LLMs produce:

  • Markdown — lines starting with one to six # characters.
  • HTML<h1> through <h6> tags.
  • Section-numbered — plain-text lines like 2.3 Findings, where the number of dotted segments sets the nesting depth.

It collects every heading with its level, normalises the indentation to the shallowest heading found (so a document that starts at H2 still nests cleanly), and renders the TOC in your chosen format. Anchors are slugified the same way most renderers generate heading IDs, so the links resolve on GitHub, common static site generators, and documentation platforms.

Practical workflow

  1. Paste the full AI-generated document.
  2. Check the generated outline — confirm all expected sections appear and none were missed. Missing headings usually mean the model used bold text or capitalised lines instead of proper heading syntax.
  3. Choose your output format for the destination (markdown for GitHub, HTML for a CMS, numbered for sharing).
  4. Copy the TOC and paste it at the top of the document as a navigation aid, or share the outline alone as a structural review before writing.

Tips

  • If no headings are detected, the document is using bold lines or plain capitalised titles instead of real headings — ask the model to “use markdown headings” and regenerate.
  • The numbered format is handy for turning a flat draft into a structured outline you can reorganise before writing.
  • Anchor matching depends on the destination platform’s ID rules. If a link does not jump, check how that renderer slugifies headings (some strip emoji or collapse punctuation differently) and adjust.
  • Compare the generated TOC against your intended section structure before sharing the document — gaps in the outline reveal sections the model skipped.