Input Markdown

Generated TOC

What is a Markdown TOC Generator?

Building documentation or a long README that's getting hard to navigate? A table of contents (TOC) makes it easy for readers to jump to the sections they care about. This tool scans your Markdown file, finds all the headings (H1 through H6), generates proper anchor links, and creates a structured TOC that you paste right at the top of your document.

The generator uses GitHub-compatible anchor format, so your TOC works perfectly on GitHub, GitLab, and other platforms that render Markdown. It handles heading levels intelligently - you can control the depth of your TOC (show only H2-H3, or include all levels through H6), and it automatically generates proper indentation and nesting so the structure is crystal clear.

Your TOC is always in sync with your headings - no more broken anchor links or outdated section references. Special characters in headings are handled correctly, and the output is ready to paste immediately. Everything happens in your browser, instantly, with zero server uploads.

How to Use the Markdown TOC Generator

Follow these steps to generate a table of contents from Markdown headings. Each step uses the actual controls on this page.

1

Paste, Upload, or Load Sample

Paste Markdown into the left Input Markdown panel, or click Upload to load a .md file. Click Sample to see example subscriber API docs. The tool scans headings (# through ######).

2

Configure Min/Max Levels

Use the Min H and Max H dropdowns to control which heading levels appear in the TOC. Output updates instantly. GitHub-compatible anchor links.

3

Copy or Download

Click Copy or Download to use the output. Paste at the top of your document. Use Clear to start fresh. All processing runs in your browser.

When You'd Actually Use This

GitHub README Files

Building a comprehensive README for your project? A TOC helps users quickly find setup, configuration, API docs, and contribution sections. GitHub automatically renders your TOC with working anchor links for perfect navigation.

Documentation Sites

Large documentation projects with 20+ pages need structure. Generate TOCs for each page and build a master TOC for the entire site. Readers navigate confidently through your documentation with clear structure.

Wiki Pages

Building company wikis or knowledge bases with long articles? A TOC at the top of each page improves usability. Works on GitHub Wikis, GitLab Wikis, and other Markdown-based wikis.

Long-Form Content

Blog posts, tutorials, guides, or any long Markdown document benefits from a TOC. Readers scanning quickly can jump to relevant sections. Especially helpful for technical tutorials with multiple steps and sections.

Common Questions

Do I need to manually create anchor links?

No. The tool generates them automatically. GitHub, GitLab, and most CommonMark-compliant platforms automatically create anchors from headings, so the generated TOC links work immediately without extra work.

Will the anchor format work on all platforms?

The generator uses GitHub-compatible anchor format, which is the most widely supported format. GitHub, GitLab, and most other Markdown platforms support this format natively. Check your platform's documentation for specific anchor behavior.

How are special characters in headings handled?

The generator automatically converts special characters to anchor-safe formats. Spaces become hyphens, uppercase becomes lowercase, and special punctuation is either converted or removed. The resulting anchors are always valid and work correctly.

Can I adjust the TOC depth?

Absolutely. The "Min H" dropdown controls the minimum heading level (H1, H2, etc.) and "Max H" controls the maximum. Want only H2-H3? Set Min to H2 and Max to H3. Need a comprehensive TOC? Include all levels from H1 to H6.

What if my headings have numbers or symbols?

They're handled correctly. A heading like "Step 1: Getting Started" converts to an anchor like #step-1-getting-started. Special characters are processed according to standard Markdown anchor rules, so links always work.

Is my Markdown content stored?

No. All TOC generation happens in your browser using JavaScript. Your Markdown never leaves your computer, and we don't store or analyze your data. Complete privacy and security.

Related Markdown Tools