Skip to main content

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

  1. Paste your Markdown document into the input box
  2. Click Generate to extract every heading
  3. 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

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.