Table of Contents Generator
Extract headings from Markdown or HTML documents to build indented tables of contents with anchor links in Markdown, HTML, or plain text.
Privacy Notice: Runs locally in your browser without uploading files to external servers or requiring an account.
Interactive Browser Workspace
Loading the interactive Table of Contents Generator workspace. Enable JavaScript in your browser to run calculations and conversions locally.
How to Use Table of Contents Generator
- Paste your Markdown (#, ##, ###) or HTML (<h1>-<h6>) document.
- Select the maximum heading depth and desired output format (Markdown, HTML nav, or numbered plain text).
- Copy the generated Table of Contents with deduplicated anchor slugs.
Methodology & Accuracy
Parses heading levels in document order and generates deterministic URL-safe anchor IDs with collision suffixing.
Examples
- Generate a clickable Markdown TOC for a technical RFC or README file.
Scope & Limitations
- Page numbers are not generated for unpaginated Markdown or HTML because reflowable documents do not have fixed pages.
Frequently Asked Questions
How are duplicate heading titles handled?
Duplicate headings receive incremental anchor suffixes (for example #overview and #overview-1) so every link remains unique.
Which heading levels are included in the generated Table of Contents?
You can configure depth from H1 through H4 so short briefs stay concise while long technical guides include nested subsections.
Can I export the Table of Contents as Markdown anchor links or HTML?
Yes. Copy ready-to-paste GitHub-compatible Markdown links (`#section-slug`) or structured HTML nested lists.
Related Tools
- Online Word Editor - Write and format rich documents in your browser with tables, headings, DOCX/Markdown import, and DOCX, PDF, HTML, and TXT export.
- Document Splitter - Split PDFs by exact page ranges or divide Markdown, TXT, HTML, and DOCX documents by headings or custom section markers into a ZIP.
- Markdown Editor with Live Preview & Export - Write GitHub-flavored Markdown with a quick formatting toolbar, live split preview, word counts, and .md/.html/.pdf/.docx export.