Summary — What Free Markdown TOC Generator Does
What This Free Tool Is
Free Markdown TOC Generator scans your Markdown for headings and produces a nested table of contents with anchor links. Every heading becomes a link to its own anchor in your rendered document. Paste your Markdown, pick your heading levels, and copy the generated TOC straight into your document's top.
Privacy: This tool runs entirely in your browser. Your text is never uploaded, logged, or cached. Close the tab and it's gone. Verify in DevTools → Network: zero requests fire.
Why It's Free (And How We Keep It Free)
Generating a TOC is pure string manipulation — cheap to run, worth doing free.
Table of Use
At-a-Glance Reference
| Input | Output | Typical size | Speed | Login needed |
|---|
| Markdown with headings | Nested TOC (Markdown or HTML) | Any size | < 10 ms | No |
Markdown TOC Generator Features
Here's what this free tool does in detail — every feature is built to solve real problems, runs entirely in your browser, and is free forever.
Configurable Heading Level Range
Pick the minimum heading level to include (H1 through H6) and the maximum. The default is min 2, max 4 — it skips H1 (which is typically the page title and doesn't belong in its own TOC) and H5/H6 (which are usually too granular for navigation). Adjust to match your document structure: long technical docs often want 2-4; short articles work with 2-3; exhaustive references might need 2-6.
If you want to process the Markdown into a full AST for custom processing instead of just extracting headings, use the Free Markdown to JSON tool.
Markdown or HTML Output
Toggle between {t('formLabels.markdown')} (indented bullet list with link syntax) and {t('formLabels.html')} (nested <ul> with proper <li> and <a> tags). The Markdown output works in any Markdown renderer — GitHub, GitLab, Bitbucket, Obsidian, Notion, Dev.to, Hashnode, Ghost, Hugo, Jekyll, Astro. The HTML output is useful when you're converting the whole doc to HTML and want the TOC pre-rendered.
Pair this with the Free Markdown to HTML Converter: generate the TOC, prepend it to your Markdown, then convert the full document.
Auto-Generated Anchor Links
Each TOC entry links to an anchor computed from the heading text using the standard GitHub-compatible slug algorithm: lowercase the text, replace spaces with hyphens, remove non-alphanumeric characters (except hyphens). So # Getting Started becomes the anchor #getting-started. These match the anchors GitHub, GitLab, and most Markdown renderers auto-generate, so your links just work without extra config.
For the plain-text version of the same content (no links, no TOC, no formatting), use the Free Markdown to Plain Text tool.
Duplicate Heading Handling
If your document has two headings with the same text (say, two ## Installation sections — one for Mac, one for Windows), the tool generates unique anchors by numbering the duplicates: #installation, #installation-1, #installation-2. This matches GitHub's behavior and ensures every TOC entry links somewhere unique.
If you want to detect duplicates before generating, use the Free Markdown to JSON tool to inspect the heading tokens directly.
Optional TOC Heading
Include or exclude a ## Table of Contents header at the top of the output. The default is to include it. You can also customize the header text — for example, # Contents, ## Sections, or localized versions like ## Inhaltsverzeichnis.
To polish the full document before publishing, run the result through the Free Markdown Formatter — it normalizes heading spacing and bullet markers.
Runs Entirely in Your Browser
The parser, the slug algorithm, the output formatting — all happen inside your browser tab. Your Markdown never leaves your device. You can verify in DevTools → Network tab that no requests fire when the TOC generates.
Same privacy guarantee on every client-side tool: Free HTML to Markdown, Free Markdown Word Counter, and the rest.
How To Use Free Markdown TOC Generator
Step 1 — Paste your Markdown
Paste a document that has headings into the input area.
Step 2 — Set heading level range
Pick min (usually 2 to skip H1) and max (usually 3 or 4).
Step 3 — Copy the TOC
Click Copy and paste the result at the top of your document.
Who Can Use This Tool
Technical writers
Adding navigation to long documentation pages before publishing.
GitHub README authors
Adding a table of contents to long README files for easier navigation.
Bloggers with long-form posts
Adding TOCs to 2000+ word posts so readers can jump to sections.
Students writing thesis drafts
Generating TOCs for Markdown thesis drafts before final conversion to PDF or DOCX.
Book authors
Building nested chapter TOCs for Markdown-based book drafts.
Frequently Asked Questions
Is this free TOC generator really free?
Yes. Every tool on freemarkdowntools.com is free forever.
Does it generate anchor links?
Yes. Each entry links to an anchor using the standard GitHub-compatible slug format (lowercase, hyphens, duplicates numbered).
Can I include only H2-H3?
Yes. Set min level to 2 and max level to 3 in the options.
Does it handle duplicate headings?
Yes. Repeated headings get numbered suffixes so every anchor is unique.
Markdown or HTML output?
Both. Toggle in the options panel. Markdown is a bullet list; HTML is a nested