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
- Paste your Markdown document, including its # headings, into the box.
- Pick the minimum and maximum heading levels and choose a bullet or numbered list.
- 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
Markdown Table Generator
Turn CSV or TSV data into a clean Markdown table online. Paste rows, pick column alignment, then copy GitHub-ready Markdown. Free and private.
Slug Generator
Turn any title into a clean, SEO friendly URL slug. Lowercase, strip accents, pick a separator and cap the length. Free, instant and private.
Strip HTML Tags
Strip HTML tags from text online and get clean plain text. Removes scripts, styles and markup, decodes entities, and keeps line breaks. Free and private.
Add Line Numbers
Add line numbers to any text online. Set the start value, step, and separator, pad numbers to align, and copy or download the result. Free and private.
Bullet List Maker
Turn lines of text into a bullet or numbered list online. Pick dash, asterisk, dot, arrow or numbers, add indent, then copy. Free and private.
Caesar Cipher
Encode and decode text with the Caesar shift cipher. Pick any shift, see the result live, and brute force all 25 shifts. Runs entirely in your browser.