Markdown navigation workflow

Generate a table of contents from Markdown headings

A long document needs working navigation. Build the table of contents from the actual heading structure instead of by hand.

01

Confirm the headings before generating

A clean heading structure produces a clean table of contents with no extra editing.

1

Paste the Markdown document

Use the full document, including all heading levels.

2

Review the heading hierarchy

Confirm heading levels reflect the intended structure.

3

Generate the table of contents

Create linked entries for each heading.

4

Insert it into the document

Place the generated list near the top of the file.

02

How headings become links

The generator reads every heading level from H1 to H6, builds the hierarchy, and emits a nested list with anchor links that match the slugified heading text.

Paste the generated TOC at the top of the document and keep the heading text unchanged so the anchors keep working.

  • Nested lists reflect heading levels
  • Anchors are GitHub-style slugs of the heading text
  • Optional numbering for sections
03

Why generated tables of contents break

  • Duplicate heading text creates colliding anchor links
  • Skipped heading levels create confusing nesting
  • Special characters in headings produce invalid anchors
  • A renamed heading leaves an outdated link behind
04

Keep navigation reliable

  • Use a consistent heading level structure throughout the document
  • Avoid duplicate heading text where possible
  • Regenerate the table of contents after heading changes
  • Test anchor links after publishing
05

Frequently asked questions

Will the anchors work on GitHub?

Yes. The generator produces the same slug format GitHub uses, so links resolve in repositories and README files.

What if two headings have the same text?

The generator appends a suffix to later duplicates, matching common renderer behavior.

Can I exclude the H1 from the TOC?

Yes. The H1 is excluded by default; only H2 and below are listed.

Is my document uploaded?

No. Generation runs locally in your browser.

06

Generation runs in the browser

The Markdown is processed locally. Document content is not uploaded for this standard processing step.

Open Markdown TOC Generator