A free browser-based tool that instantly generates a nested table of contents from any Markdown document. Paste your Markdown, configure heading depth, choose list style, and copy GitHub-compatible anchor links in one click.

Markdown TOC Generator is a free, client-side tool that takes any Markdown document and produces a nested table of contents with GitHub-compatible anchor links. Paste your content, adjust heading depth, pick list style, and copy — the whole flow takes seconds.
No signup, no file upload, no server. Everything runs in the browser.
Every non-trivial Markdown document — a GitHub README, a wiki page, a technical spec, or a changelog — benefits from a table of contents at the top. Readers can jump directly to the section they need instead of scrolling through hundreds of lines.
But generating that TOC by hand is tedious:
[Heading Text](#heading-text)For a 30-heading document that is 10–15 minutes of error-prone manual work. Miss one heading, indent a sub-section incorrectly, or miscalculate the anchor for a heading with special characters — and the TOC links silently break.
Drop your full Markdown document into the left-hand input panel. The tool parses headings instantly as you type — no button to press, no "generate" delay.
Two sliders control which headings appear in the TOC:
The most common configuration — Min H2, Max H3 — produces a two-level TOC that covers all main sections and their direct sub-sections without overwhelming the reader.
Toggle between unordered (hyphen-prefixed) and ordered (numbered) list output. Unordered is the GitHub convention and the most widely expected format. Ordered lists work well for numbered guides and tutorials where section sequence matters.
The right-hand panel shows the generated TOC as clean Markdown text. Click Copy TOC to send it to the clipboard, then paste it at the top of your document.
The anchor algorithm matches GitHub's own implementation:
This produces anchors that work in:
The parser splits the Markdown input on newlines and applies a single regex match to identify ATX-style headings:
/^(#{1,6})\s+(.+)$/
The level is derived from the length of the captured hash sequence. Only ATX-style headings (# prefix) are supported — not Setext-style (=== / --- underlines), which are uncommon in modern Markdown.
The anchor is computed purely in TypeScript, client-side, with no external library:
function makeAnchor(text: string): string {
return text
.toLowerCase()
.replace(/[`*_[\]()~]/g, "")
.replace(/[^\w\s-]/g, "")
.trim()
.replace(/\s+/g, "-")
.replace(/-{2,}/g, "-");
}This pipeline is tested against GitHub's own rendering to ensure link accuracy.
The TOC generator computes the minimum heading level in the filtered set and uses it as the indentation base — so a document starting at H2 produces a flat TOC without unnecessary leading whitespace:
const base = Math.min(...filtered.map((h) => h.level));
return filtered.map((h) => {
const indent = " ".repeat(h.level - base);
const bullet = ordered ? "1." : "-";
return `${indent}${bullet} [${h.text}](#${h.anchor})`;
}).join("\n");A long README without navigation forces readers to scroll. Adding a TOC near the top — after the project description and badges — lets developers jump directly to Installation, Configuration, or API Reference. Markdown TOC Generator produces the entire TOC from a README paste in under five seconds.
Product specs, architecture decision records (ADRs), and RFC documents often run to dozens of sections. A TOC at the top of the document lets reviewers navigate directly to the section under discussion without losing context.
Sites built with Docusaurus, VitePress, or MkDocs support Markdown natively. Adding a hand-authored TOC to long reference pages improves readability. The generator produces TOC links that these frameworks resolve correctly, since they use the same anchor algorithm.
GitHub and GitLab wikis render anchor links from headings the same way as READMEs. A CHANGELOG.md with many version entries benefits from a TOC so readers can jump to a specific version. Markdown TOC Generator handles the entire document in one pass.
Writers working in Markdown editors (Typora, Obsidian, iA Writer) can paste their draft to get a structural overview of the document as a flat TOC list. Reviewing the TOC exposes missing sections, duplicate headings, or heading hierarchy problems that are easy to miss inline.
Editor-specific TOC plugins (VS Code extensions, Obsidian plugins) require installation and only work within that editor. Markdown TOC Generator works in any browser — no install, no editor lock-in.
markdown-toc, doctoc)CLI tools require Node.js, global npm install, and a terminal session. For a quick one-off README update, that overhead is unnecessary. The web tool is faster for occasional use.
Manual TOC creation breaks whenever headings are renamed or added. Re-generating from this tool takes 10 seconds vs. 10 minutes of manual re-sync.
Pasting a full document into a chat interface just to generate anchor links is slow and the anchor output may differ from GitHub's rendering. This tool is purpose-built and deterministic — it uses the exact same algorithm every time.
Try it now: markdown-toc-generator.tools.jagodana.com
The client needed a robust developer tools solution that could scale with their growing user base while maintaining a seamless user experience across all devices.
We built a modern application using Markdown and Developer Tools, focusing on performance, accessibility, and a delightful user experience.
Category
Developer Tools
Technologies
Date
May 2026
More work in Developer Tools