Boneyard Tools

Markdown Table of Contents Generator

Paste your Markdown to build a nested table of contents from its headings. Each entry links to a GitHub-style anchor, headings inside code blocks are skipped, and you can choose the heading levels and list style.

How to generate a Markdown table of contents

  1. Paste your Markdown document, including its # headings, into the box.
  2. Pick the minimum and maximum heading levels and choose a bullet or numbered list.
  3. Copy the generated table of contents or download it as a toc.md file.

Examples

Headings to a nested TOC

# Title
## Setup
## Usage
### Details
- [Title](#title)
  - [Setup](#setup)
  - [Usage](#usage)
    - [Details](#details)

Duplicate headings get numbered anchors

## Notes
## Notes
- [Notes](#notes)
- [Notes](#notes-1)

Frequently asked questions

How are the anchor links generated?

They follow GitHub's rules: the heading text is lowercased, punctuation is removed, and spaces become hyphens. So '## Getting Started!' links to #getting-started, which jumps to that heading on GitHub and most Markdown renderers.

What happens when two headings are the same?

GitHub appends a counter to keep anchors unique, and so does this tool. A second 'Notes' heading links to #notes-1, a third to #notes-2, so every link in the table of contents points to the right place.

Are headings inside code blocks included?

No. Lines that start with # inside a fenced code block (``` or ~~~) are code, not headings, so they are ignored. Only real ATX headings outside code fences end up in the table of contents.

Can I limit which heading levels appear?

Yes. Set a minimum and maximum level to skip the page title or very deep headings. For example, min 2 and max 3 includes only ## and ### headings, and the shallowest included level still sits flush at the left.

Does it support ordered (numbered) lists?

Yes. Toggle the ordered option to emit a numbered list using 1. instead of bullet points. Markdown renderers auto-number the items, so nesting still works correctly.

Is my Markdown uploaded anywhere?

No. The table of contents is built entirely in your browser, so your document never leaves your device and nothing is stored on a server.

Related tools