Markdown TOC generator
Generate a linked table of contents from the headings of a Markdown document, with GitHub-style anchors.
Related tools
Markdown TOC generator
Paste a Markdown document and get a linked table of contents back instantly. The tool scans the text for ATX headings — the # to ###### kind — and builds a nested Markdown list ready to paste at the top of a README, a wiki page or any documentation file. Heading-like lines inside fenced code blocks are ignored, so example Markdown in your snippets never leaks a phantom entry into the TOC.
Anchors follow GitHub's rules: the heading text is lowercased, spaces become hyphens and punctuation is stripped, while letters with diacritics are kept — GitHub keeps them too, so a heading like "Číslo účtu" links as #číslo-účtu and the TOC works on github.com, GitLab and most Markdown renderers out of the box. When several headings share the same text, the second and third get -1 and -2 suffixes, exactly as GitHub numbers them. Bold, italic, inline code and link markup inside a heading disappears from the label; its readable text stays.
The Levels select controls how deep the list goes: the default H2–H3 suits most READMEs, H1–H6 captures everything, and H2 only or H2–H4 fit flatter or deeper documents. Style switches between bullets and a numbered list, unticking Links produces a plain-text outline instead of anchor links, and Indent with tabs swaps the two-space nesting for tab characters, matching whichever style your repository uses.
Everything runs locally in your browser — the document is never uploaded, so private specs and unreleased drafts stay on your device. The tally under the output counts the headings found and the TOC lines produced, and the result can be copied or downloaded with one click.