Skip to content
Free · No signup · Instant

Table of Contents Generator

Paste any markdown document and get a perfectly formatted TOC with anchor links in seconds. Free, runs in your browser.

All heading levelsCorrect anchorsGitHub compatibleNo signup
Markdown Input
Table of Contents11 headings
- [My Project](#my-project)
  - [Introduction](#introduction)
  - [Getting Started](#getting-started)
    - [Prerequisites](#prerequisites)
    - [Installation](#installation)
  - [Usage](#usage)
    - [Basic Usage](#basic-usage)
    - [Advanced Configuration](#advanced-configuration)
  - [API Reference](#api-reference)
  - [Contributing](#contributing)
  - [License](#license)

How it works

Three steps. Five seconds.

1

Paste

Drop your markdown document into the editor — README, blog post, docs page, anything with headings.

2

Generate

The TOC appears instantly with correct anchor links for every heading, indented by level.

3

Copy or Download

Copy the markdown TOC to paste at the top of your document, or download as a .md file.

Built for developers and writers

Stop writing TOCs by hand. Paste, copy, done.

01

Instant Generation

The table of contents updates in real time as you type or paste. No button to click.

The generator parses your markdown in the browser and produces a correctly indented TOC with anchor links. Changes reflect immediately — no page reload, no server round-trip.

02🔗

Correct Anchor Links

Every heading becomes a properly formatted anchor link following GitHub's ID generation rules.

Headings are lowercased, spaces become hyphens, and special characters are stripped — exactly how GitHub generates heading IDs. Links that work on GitHub, GitLab, and most markdown renderers.

03📐

Proper Indentation

H1, H2, H3 headings are indented correctly to show document hierarchy at a glance.

H1 headings appear at the root level. H2 headings are indented two spaces. H3 four spaces. The resulting list visually represents your document's structure and renders as a nested list.

04🔒

100% Client-Side

Your document never leaves your browser. Generation happens entirely in JavaScript — no upload, no server.

The TOC generator runs as JavaScript in your browser tab. There is no server, no API call, no file upload. You can disconnect from the internet after the page loads and it still works.

Frequently asked questions

Everything you need to know.

1

How do I add a table of contents to a markdown document?

Paste your markdown document into the left panel. Copy the generated TOC from the right panel and paste it at the top of your document, just below your main title.

Need to convert your markdown too?

Turn markdown into a polished PDF, Word doc, or standalone HTML — free, no signup.