Hashdraft
← All free tools
toc

Table of contents generator

Paste your Markdown and get a table of contents from the headings, with GitHub-style anchor links. Choose the depth and list style, then copy. Runs entirely in your browser.

Markdownpaste, or drop a .md file


Building a README?

Add a TOC with the README generator, or write docs in the desktop app.

Download Hashdraft

Markdown table of contents

Generate linked navigation from Markdown headings

A Markdown table of contents turns document headings into a compact set of anchor links. It helps readers scan a long README, guide, specification, or release document and jump directly to the section they need without manually maintaining every link.

Extract headings automatically

The generator parses heading tokens rather than guessing from arbitrary hash characters, then uses the visible heading text as each link label.

Choose depth and style

Include only the heading levels useful for navigation and select a bulleted or numbered list to match the document.

Create GitHub-style anchors

Heading text becomes a lowercase slug while Unicode letters, including Cyrillic, remain meaningful in the generated destination.

How to add a table of contents to Markdown

  1. Paste the complete Markdown document so the generator can find every heading in context.
  2. Choose the maximum heading depth, list style, and whether the page title should be skipped.
  3. Copy the generated links and place them near the beginning of the document, then test them in the final renderer.

Markdown table of contents questions

Should the H1 appear in the contents?

Usually the H1 is the document title, so skipping it avoids a link that simply repeats the page name. Include it when the destination treats it as a useful section.

How deep should the TOC go?

Two or three heading levels are enough for most documents. A deeper list can become harder to scan than the page it is meant to simplify.

Hashdraft for Windows

Navigate long Markdown without maintaining a manual TOC

Hashdraft builds a document outline from headings and tracks the current section while you read or edit the local file.

  • Collapsible heading outline with section tracking
  • In-document anchors and wiki links
  • Find, replace, and synchronized Split mode
Hashdraft desktop Markdown editor showing source and rendered preview in Split mode