Markdown TOC Generator Tool (Auto-create from Headings)
Automatically generate a Table of Contents (TOC) from Markdown headings (H2-H4, etc.). Copy the 'editable' output and use it immediately.
Markdown TOC Generation (Input/Output)
Just paste itExtracts headings from # to ####. Ignores # inside code blocks.
TOC Creation Markdown (Options)
Basic Settings
උසස් සැකසුම්
Heading to TOC: Usage and Examples
How to Use
-
1
Paste Markdown
-
2
Select target levels (H2 Only / H2-H4, etc.)
-
3
Copy and paste into your document
Input content is processed within the browser.
Example
# Document Title ## Overview ## Usage ### Installation ### Configuration ## FAQ ## FAQ
## Table of Contents - [Overview](#overview) - [Usage](#usage) - [Installation](#installation) - [Configuration](#configuration) - [FAQ](#faq) - [FAQ](#faq-2)
Notes & Tips
Specifications
Heading Extraction Rules
- Extracts # to #### Markdown headings (specified in settings)
- # inside code blocks (```) are not treated as headings
Anchor Generation Rules (Tool Default)
- Trim heading text (remove whitespace)
- Convert English to lowercase
- Convert spaces to -
- Remove symbols (keep -)
- Collapse consecutive -- to -
- Remove leading/trailing -
- Append -2, -3... for duplicate anchors
සටහන්
- TOC link behavior may vary depending on the environment (Git hosting, Markdown viewer, etc.). Edit the output as needed.
- Setting anchor style to 'Custom' makes it easier to edit for specific environments.
- Exclude keywords are matched partially.
නිතර අසන ප්රශ්න
I want H2 only
You can select 'H2 Only' in Target Levels.
How are anchor names determined?
The anchor generation rules for this tool are listed. You can manually edit the output to fine-tune it for your environment.
What about duplicate headings?
If multiple identical headings exist, sequential numbers like -2, -3 are added to avoid anchor duplication (e.g., #faq-2).
I want to exclude specific headings
Use the 'Exclude Keywords' in Advanced Settings to omit headings containing those characters.
Can I create a TOC without links (text only)?
Set Anchor Style to 'No Anchor' to generate a text-only TOC.