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
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
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
Detected headings
Anchors match GitHub Flavored MarkdownNo headings detected yet. Add a line that starts with #, ##, and so on, or load a sample.
How to use
- 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.
- 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.
- 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.
- 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.
- 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
Markdown Editor
Live markdown editor with toolbar, preview, table of contents, and .md or .html download.
Open tool
ConverterMarkdown to HTML Converter
Convert Markdown to clean HTML with a live preview and copy button.
Open tool
ConverterHTML to Markdown Converter
Convert HTML to GFM Markdown with tables, code, and reference links.
Open tool
GeneratorMarkdown Table Generator
Editable grid, column alignment, paste from spreadsheet, live preview.
Open tool
GeneratorSlug Generator
Turn titles into clean URL slugs.
Open tool