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.
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:
- Markdown produces a bulleted list with
[Title](#anchor)links. - HTML produces a nested
<ul>with<a href="#anchor">links. - Numbered produces a
1.,1.1,1.2style outline with no links.
Anchors are slugified the same way most renderers generate heading IDs, so the links resolve on GitHub, common static site generators, and documentation platforms.
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.