Markdown

Markdown TOC Generator

Instantly Extract TOCs from Long Markdown Docs

This free tool automatically extracts headers (like #, ##) from your Markdown text and instantly generates a Table of Contents (TOC).
When writing long documents such as README.md or technical blogs, you can greatly reduce the hassle of manually creating a TOC and setting up anchor links.

How to Use

Auto-generate a Markdown TOC in just 3 simple steps. You can also customize output settings intuitively.

STEP1

Input Text and Select Extraction Level

Paste your Markdown text into the left input area. Then, select the header levels (H1 to H4) you want to extract using the options at the top.

Input Markdown text and select target headers
STEP2

Customize Output Format

Toggle the "List Format" and "Internal Links" checkboxes to match your needs. Enabling internal links will generate an anchor-linked TOC that jumps to each section.

Generate TOC with list and anchor link settings
STEP3

Copy the Generated TOC

Once the table of contents appears in the right output area, simply copy it and paste it into your Markdown document.

Copy the output TOC for use
Key Features

One-Click Extraction

Just paste your text, and the tool accurately picks up only the headers from complex Markdown structures.

Flexible Hierarchy Levels

Freely select which header depths to include in the TOC, ranging from H1 down to H4.

In-Page Anchor Link Support

Automatically generates a TOC with internal links that function perfectly on platforms like GitHub.

Auto List Formatting

Automatically organizes and outputs proper indents and list markers (-) based on the header hierarchy.

Secure Local Processing

No data is sent to our servers. Safely process unpublished internal documents completely within your browser.

Ideal For

Open Source Developers

For those whose README.md files are getting long and want to add a TOC for better readability.

Tech Bloggers

For writers publishing long-form articles on Markdown-supported platforms like Dev.to or Hashnode.

Document Managers

For those tired of manually adjusting in-page link IDs for company Wikis or specifications.

All Markdown Users

Perfect for quickly grasping the overview of complex document structures.

Frequently Asked Questions
How are the internal anchor links generated?
Based on standard Markdown specs, we automatically generate anchor links by converting header text to lowercase and replacing spaces with hyphens (e.g., `[Header](#header)`). This works natively on GitHub and most platforms.
What happens if headers contain code blocks or special characters?
The tool tries to extract them as plain text as much as possible, though some complex markdown inside headers may not perfectly match the anchor ID depending on the platform.
Is this tool free to use?
Yes, no account registration is required, and you can use it for free as many times as you like.
Is it safe to input highly sensitive text?
Yes. All processing happens locally in your device's browser. Your text content is never saved or sent to any external server.