Markdown Table of Contents Generator
Markdown Table of Contents Generator reads the headings in a Markdown document and returns a nested list of anchor links you can paste at the top.
How to use it
- Paste your Markdown document into the input box
- Click Generate to extract every heading
- Copy the generated table of contents with one click
It recognises ATX headings only — the # to ###### form — so Setext headings underlined with === or --- are ignored. Each link's anchor is the heading text lowercased with spaces turned to hyphens and anything that is not a letter, digit or hyphen removed, so accented or non-Latin characters drop out: "Café Ordering" becomes #caf-ordering. Repeated heading text gets -1, -2 and so on. The slug style follows GitHub-flavoured renderers and may not match every platform. Indentation in the list mirrors the heading levels actually present. For editing and previewing the document itself, use Markdown Editor & Preview; this tool only builds the contents list, locally, with a 1 MB input limit.
FAQ
Anchors keep only lowercase letters, digits and hyphens, so "Résumé" becomes #rsum. If your target renderer keeps Unicode in anchors, adjust those links by hand.
No. Only ATX headings written with leading # characters are detected.
The first keeps the plain slug; the next ones get -1, -2 and so on, matching how GitHub-style renderers de-duplicate anchors.