Markdown Table of Contents Generator

Use this free online Markdown TOC generator to paste or upload a file, choose heading levels, preview GitHub-style anchor links, and copy the result. It runs client-side in your browser with no signup.

Markdown source
9 headings foundYour Markdown stays in this browser
Live Preview

Table of Contents

Acme CLI

Install and configure the command-line tool.

Getting started

Requirements

Installation

Commands

Build

Deploy

Configuration

Troubleshooting

Create a Markdown TOC that keeps readers oriented

A table of contents turns a long README, documentation page, or set of notes into usable navigation. This generator does the repetitive part while leaving you in control of which headings appear.

How to create a table of contents in Markdown

You do not need to write every anchor by hand. Generate the nested list here, check it against the document preview, then paste it into your Markdown file.

01

Add your Markdown

Paste a document into the editor or upload a .md or .markdown file. The generator detects Markdown headings from H1 through H6.

02

Choose the heading depth

Set the first and last heading levels to include. For a typical GitHub README, choosing H2 through H3 keeps the TOC useful without exposing every small subsection.

03

Preview, copy, or insert the TOC

Use the preview to check that each generated link reaches the expected heading in this tool, then verify the finished document on its publishing platform. Select Copy TOC to paste the result yourself, or select Insert into Markdown to add a managed TOC after the document's first H1.

GitHub-style anchors, with clear compatibility limits

The generator detects Markdown headings from H1 through H6 and builds anchors for ordinary spaces, punctuation, repeated headings, and Unicode text. It does not call GitHub or GitLab, and its output is not tied to a tested version of either platform.

Raw HTML headings such as <h2 id="custom">Setup</h2> are not detected. Custom heading IDs written with renderer-specific attribute syntax are not read or preserved. Use Markdown headings and check any custom anchors in the final renderer.

01

GitHub Markdown TOC generator for README files

The generated anchors follow the GitHub-style behavior shown in the preview, including lowercase destinations and numeric suffixes for repeated headings. GitHub remains the final source of truth for a README after it is rendered.

02

GitLab and other renderers

If you need a GitLab Markdown TOC generator or publish through a wiki, documentation engine, or static-site generator, create the TOC here and verify every link there. Those renderers may normalize punctuation, Unicode, and duplicate headings differently.

03

List format

The generator currently returns a nested unordered list rather than an ordered list. If your document requires numbered entries, convert the list markers manually after copying the TOC.

Where a generated TOC helps most

01

GitHub READMEs

Give contributors a quick route to installation, usage, configuration, API notes, and troubleshooting without forcing them to scroll through the entire repository README.

02

Technical documentation

Make a long Markdown guide easier to scan before it moves into a docs site, wiki, or static-site workflow. Select only the levels that represent meaningful navigation.

03

Long notes and assignments

Add a compact outline to research notes, course material, or project handoffs while preserving the hierarchy already expressed by the headings.

Online generator, editor extension, or CLI?

This browser-based Markdown TOC generator is a good fit for a one-off README, a quick correction, or a file you do not want to send to a server. If headings change every day, an editor extension or CLI step may be a better way to regenerate the TOC as part of your normal workflow.

Choosing a Markdown table of contents workflow
ApproachBest forKeep in mind
Online generatorQuick edits and one-off filesRegenerate after headings change
Editor extensionFrequent work in one editorRequires installation and editor setup
CLI or CI stepRepositories with repeatable buildsRequires project configuration

Generate a Markdown TOC without uploading your document

This client-side Markdown TOC generator reads the text and selected Markdown file in your browser. No signup is required, and the generator does not send the document to a conversion server. See the Privacy Policy for details about the site's other network requests and data-handling practices.

Markdown table of contents FAQ

Practical answers for README authors, developers, technical writers, and anyone working with a long Markdown file.

1

Does Markdown support a table of contents?

Core Markdown does not define one universal TOC directive. A portable approach is a nested Markdown list whose links point to heading anchors. The exact anchor rules depend on the renderer.

2

How do I add a table of contents to a GitHub README?

Paste or upload the README here, select the heading levels you want, copy the generated TOC, and paste it near the top of the file. Preview the links here, then verify them again after GitHub renders the README.

3

Can I include only H2 and H3 headings?

Yes. Set From to H2 and Through to H3. The generated list will exclude the H1 title and headings at H4 through H6.

4

How are duplicate Markdown headings handled?

The first heading uses the base anchor. Later headings with the same generated slug receive numeric suffixes such as -1 and -2, keeping the preview links unique.

5

Does this tool automatically update my Markdown TOC?

It does not update continuously. After inserting a managed TOC, edit your headings and select Update Markdown to refresh it. For automatic updates inside a repository, consider an editor extension or a CLI step.

6

Is my Markdown uploaded to a server?

The generator processes your text and selected Markdown file locally in your browser.

7

Will the anchors work with non-English headings?

The generator retains Unicode letters and numbers, so non-English headings can produce readable anchors. Because platforms may use different slug rules, verify the links in the renderer where the document will be published.

Build Your Markdown Table of Contents

Paste your document, choose the heading levels, and generate a linked TOC in seconds.