Zero Signup ToolsFree browser tools

Text Tools

Markdown TOC Generator

Generate a Markdown table of contents from any markdown document. GitHub-flavored anchor slugs, level filters, collapsible details block, HTML and plain output.

Load a sample

0 headings found

Headings inside fenced code blocks are skipped automatically. Anchors are generated with the same rules GitHub uses, so the TOC links work in any GitHub README, Gist, or wiki page.

Markdown TOC

0 included

Paste markdown on the left or load a sample above to generate a table of contents.

The output above mirrors what you will see when GitHub or any GFM-compatible renderer parses your document. Heading skips are handled so the indent never jumps levels.

Output options

Format

Markdown produces a list of clickable anchor links. HTML emits a nested <ul> suitable for non-markdown sites. Plain text drops the links and prints the heading outline only.

Heading levels

Set Min to H2 to skip the document title. Lower the Max if you only want a top-level outline.

Indentation

GitHub renders 2-space and 4-space indents identically. Use 2 spaces for compact source, 4 if your team has linted to that standard.

Markdown style

Numbered lists use "1." on every line; markdown renderers auto-number them, so reordering the source is safe.

Detected headings

Anchors match GitHub Flavored Markdown

No headings detected yet. Add a line that starts with #, ##, and so on, or load a sample.

How to use

  1. Paste a markdown document into the source area on the left, or click a sample (Project README, Long-form blog post, API documentation) to load a working example.
  2. Pick an output format: Markdown for a list of clickable [Title](#anchor) links, HTML for a nested <ul>, or Plain text for a simple outline.
  3. Use Min level and Max level to control depth. Set Min to H2 to skip the document title, or lower Max to H3 if you want a shorter outline.
  4. For Markdown output, choose your bullet character or switch to a numbered list, set the indent style your team uses (2 spaces, 4 spaces, or tab), and optionally wrap the TOC in a collapsible <details> block for GitHub READMEs.
  5. Click Copy TOC to copy the result, then paste it into your README, blog post, or wiki page. Use the detected-headings panel below to copy a single anchor link if that is all you need.

About this tool

Markdown TOC Generator builds a clean, GitHub-compatible table of contents from any markdown document. Paste a README, blog post, design doc, or wiki page and the tool extracts every heading (both # ATX style and the Setext underline style), generates the same anchor slugs GitHub generates so the links work in any README, Gist, or wiki, and renders a nested list you can drop straight into your file. Headings inside fenced code blocks (``` and ~~~) are skipped automatically, so a code sample that contains the literal text '# This is a comment' does not pollute the TOC. Inline markdown in heading text (links, code spans, bold, italics) is stripped so the visible label reads cleanly while the slug still uses the full heading text the way GitHub does. Output is available in three formats: a Markdown nested list with clickable [Title](#anchor) links, a nested HTML <ul> for non-markdown sites, or a plain text outline that drops the links and just prints the heading structure. Markdown output is highly configurable: pick your bullet character (-, *, or +), switch to a numbered list (1.) for a stable order even when sections move, choose 2-space, 4-space, or tab indentation, and optionally wrap the whole list in a collapsible <details>/<summary> block, which is the pattern most modern GitHub READMEs use to keep a long TOC out of the way until a reader expands it. A heading-level filter lets you skip the document title (set Min to H2) or limit the depth of the outline (set Max to H3). Headings that skip levels (an H1 followed directly by an H4) are normalized so the indent never jumps two steps, which keeps the rendered list visually aligned. The detected-headings panel shows every heading the tool found, the level it was assigned, and the anchor slug it would link to, with one-click anchor copy, so you can verify the output before pasting. Useful for project READMEs on GitHub and GitLab, technical blog posts, API reference docs, internal handbooks, design RFCs, ADR records, MkDocs and Docusaurus pages, and any markdown file long enough to warrant navigation. Everything runs locally in your browser, so the documents and proprietary docs you paste here never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsText Tools