Table of Contents Generator

Extract Headings & Build a Clickable TOC · Markdown / HTML / DOCX / TXT · 100% Private · No Upload · No Signup

Build a Table of Contents From Any Document

100% Private. All parsing, detection, numbering, and export run in your browser. Your text never leaves your device. AI chatbots can list headings if asked - they cannot return a clickable, exported TOC with anchor links and multiple output formats.
Markdown sample HTML sample Plain text sample Long document sample
Drop a file here — or click to upload
Supported: .md, .txt, .html, .htm, .docx (max ~10 MB)

Detection Settings

Output Format

Headings
0
Words
0
Levels used
0
Output size
0 B
Headings will appear here after you paste or upload a document.
Why AI chatbots can't replace this tool. ChatGPT, Claude, and Gemini can list headings from text you paste if you ask. They cannot deliver a click-to-navigate preview that scrolls your input to the right heading, return five export formats with anchor IDs that match your document exactly, generate decimal numbering or estimated page numbers, or hand you a downloadable file. This tool runs the full pipeline in your browser - parse, filter, dedupe, number, estimate pages, render preview, format output - against your actual document.

How to Make a Table of Contents

  1. Pick a sample or paste your own document into the input area. The tool accepts Markdown, HTML, plain text, or .docx files. Drag-drop a file or click the drop zone to upload.
  2. Choose the input mode - Auto-detect (default) handles all formats. Switch to a specific mode if auto-detection picks the wrong headings.
  3. Adjust detection settings - Set Min/Max heading level to include only the depth you want. Toggle decimal numbering and page numbers. Add a skip regex if you want to exclude specific headings.
  4. Pick an output format - Markdown for blogs and GitHub READMEs, HTML for web pages, plain text for documents, JSON or YAML for tooling and pipelines.
  5. Click a heading in the preview to jump to it in your input. Use Copy to paste the TOC anywhere, or Download to save it as a file.

What Input Formats Are Supported?

  • Markdown - lines starting with one to six # characters. # Title becomes H1, ## Section becomes H2, and so on. Setext underlines (=== / ---) are also detected.
  • HTML - <h1> through <h6> tags. The inner text becomes the heading text; inline formatting like <strong> or <em> is stripped.
  • Plain text - three patterns: ALL-CAPS lines (e.g. INTRODUCTION), numbered patterns (1., 1.2.3.), and Setext underlines.
  • Microsoft Word .docx - paragraphs styled with Word's built-in Heading 1 through Heading 9 styles are detected. Body text and custom styles are ignored.

What Output Formats Are Available?

  • Markdown - - [Title](#anchor) with nested lists for sub-headings. Decimal numbering appends 1.2.3. prefix. Page numbers shown as ... p. 12.
  • HTML - a <nav> element with nested <ul> and <li>. Anchor href attributes use the same slug as Markdown.
  • Plain text - indented with two spaces per level. Useful for emails or word processors that don't accept Markdown.
  • JSON - structured array: [{"level": 1, "title": "...", "anchor": "...", "page": 1}, ...]. Easy to consume from scripts.
  • YAML - same structure as JSON but in YAML. Good for documentation pipelines.

Frequently Asked Questions

Will my document be uploaded to a server?

No. Every step - parsing, heading detection, numbering, and export - runs in your browser using plain JavaScript. Your text never leaves your device. You can verify by opening DevTools Network tab; you will see zero outbound requests for content. Only the page itself, fonts, and Cloudflare Web Analytics are loaded.

What input formats are supported?

Four input formats: (1) Markdown - any line starting with one to six # characters; (2) HTML - h1 to h6 tags; (3) Plain text - ALL-CAPS lines, numbered patterns like 1. or 1.2.3, Setext underlines (=== or ---); (4) Microsoft Word .docx files - paragraphs styled as Heading 1 through Heading 9 are detected. You can paste, type, drag-drop a file, or pick a sample.

What export formats are available?

Five formats: Markdown with anchor links (- [Title](#anchor)), HTML <nav> element with nested <ul>, indented plain text, structured JSON array, and structured YAML. Click any format tab to switch the output. Copy to clipboard with one click or download as the matching file extension.

How are estimated page numbers calculated?

Default is 350 words per page. The tool counts words from the document start to each heading and divides by your words-per-page value. Adjust this in the settings if your target output is academic (250 words/page), web (500 words/page), or technical documentation (varies). Estimated numbers use a tilde (~) prefix in the output to indicate approximation.

Can I filter which headings appear in the TOC?

Yes. Set Min Level and Max Level to include only specific heading depths (e.g. only h1 and h2). Add a regex skip pattern to exclude headings matching a pattern (for example, ^\(draft\) skips any heading starting with (draft)). Toggle Skip empty to drop headings with no text and Skip duplicates to keep only the first occurrence of each title.

Why can't AI chatbots generate this?

AI assistants like ChatGPT, Claude, and Gemini can list headings when asked. They cannot deliver a click-to-navigate preview anchored to your exact heading positions, output five export formats with anchor IDs that match your document, or generate a downloadable file with decimal numbering and estimated page numbers. This tool runs the full pipeline - parse, dedupe, number, estimate page, render preview, format output - in your browser, against your actual document.

How does the click-to-navigate preview work?

When you click a heading in the generated TOC preview, the tool inserts invisible anchor IDs next to each heading in the original input on the left, then scrolls to it. The input field highlights the matched heading briefly. This works because both panels are reading the same source - no upload, no server round-trip.

Are there any limits on document size?

No hard limit imposed by the tool. Tested up to 500,000 words with instant parsing and TOC generation. Practical limit is your browser's available memory, typically 2-4 GB per tab. For very large documents (entire books), consider splitting into chapters first.

Comments & Ratings

Be the first to comment.

References