Loading Markdown TOC Generator...

Creating a Table of Contents from Your Markdown

Input

Add Your Markdown

Start with any Markdown file that contains headings. It doesn't matter whether you write in GitHub-flavored Markdown, standard CommonMark, or some other flavor — the generator scans each heading level automatically:

Paste it in: Copy your Markdown document and drop it right into the editor
Load a file: Click "Upload" and choose a .md or .markdown file from your computer
Use the sample: Click "Sample" to load example Markdown and see the generator work

Sample: Markdown with a Few Heading Levels

Here's some Markdown that nests its headings several levels down:

# Backpacking Handbook

A short intro paragraph.

## Planning Your Route

Notes on picking a trail.

### Choosing a Map

Which maps to carry.

### Checking the Weather

Reading the forecast.

## Packing Your Gear

What to bring along.
Options

Tune the TOC Your Way

A few controls put you in charge of how the final table of contents looks. It works nicely for GitHub README files, project documentation, and team wikis:

Depth limit: Choose where to stop — H1 only, through H2, through H3, and beyond
List format: Pick bulleted (-) or numbered (1.) output, whichever suits your doc
Smart indenting: Nested headings are indented automatically so the hierarchy stays clear
Output

Take Your Finished TOC

The table of contents builds instantly, with clickable anchor links that follow proven TOC conventions. Once it's ready you can:

Copy in one click: Push it to the clipboard and paste it into your Markdown file
Save a file: Export it as a .md file to hold onto for later
Jump-to links: Each line links to its heading via a slugified anchor

Sample: The TOC It Produces

This is the TOC you'd receive, with every entry linked to its heading:

# Table of Contents

- [Backpacking Handbook](#backpacking-handbook)
  - [Planning Your Route](#planning-your-route)
    - [Choosing a Map](#choosing-a-map)
    - [Checking the Weather](#checking-the-weather)
  - [Packing Your Gear](#packing-your-gear)

How Heading Anchors Are Built

Each entry in the TOC points at an anchor id derived from the heading text. The slug is worked out in a fixed order, and knowing the steps makes it easy to predict exactly where a link will land:

1

Lowercase everything. "Getting Started" and "GETTING STARTED" both settle on the same slug.

2

Drop the punctuation. Periods, commas, colons, slashes, and similar symbols are removed rather than kept.

3

Swap spaces for hyphens. Every run of whitespace between words collapses into a single dash.

## Getting Started          ->  #getting-started
### API Keys & Tokens       ->  #api-keys--tokens
#### Step 1: Install It     ->  #step-1-install-it

Because this mirrors the slug rules that GitHub-flavored Markdown uses, the anchors keep working when you paste your file back into a repository or wiki.

TOC Generator, Question by Question

How deep does the outline go, and can I stop it early?

You decide. The depth control walks from H1 all the way down to H6, but you can cap it wherever you like — H1 and H2 only for a tidy summary, or the full six levels when you want a granular map of a long spec. Anything below your chosen cut-off is simply skipped, so a busy document can still produce a short, scannable list.

What happens when two headings share the same name?

Repeated titles like "Examples" appearing three times are a classic gotcha, because a raw slug would collide. Following the GitHub convention, the first match keeps the plain slug and later duplicates gain a numeric suffix (#examples, then #examples-1, #examples-2), so every link still lands on the right section.

Will the anchors match the ones GitHub generates?

That's the goal. The slug format follows the same lowercase, strip-punctuation, spaces-to-hyphens recipe that GitHub, GitLab, and other CommonMark-based renderers apply, so the jump-links keep working when the file goes back into a README or wiki. If you want to eyeball the rendered result, drop it into the Markdown viewer first.

Bulleted or numbered — which one should I pick?

Whichever reads better for your doc. Flip the list-style switch to move between a bulleted layout (-) and a numbered one (1.); bullets tend to suit reference material, while numbers help when the sections are meant to be followed in order. Either way, nested headings stay indented so the hierarchy is obvious at a glance.

If I rename a heading, do I have to rebuild the TOC?

The generated block is plain Markdown, not a live link back to your document, so a TOC you copied earlier won't follow along after you rename or reorder sections. The quickest fix is to re-run the generator on the updated text and paste the fresh list in. Since it regenerates in an instant, most people just do a final pass right before publishing.

Any catch, sign-up, or usage cap?

None. Build as many tables of contents as you need with every option unlocked, no account required. When you're done here, the rest of the toolkit — the Markdown formatter and Markdown to HTML converter among them — is free the same way.