No Login Data Private Local Save

Markdown TOC Generator - Online Table of Contents

11
0
0
0

Markdown TOC Generator

Generate a clean, GitHub-compatible Table of Contents for your Markdown documents instantly.

Free & Online
Markdown Input 0 headings
Generated TOC 0 items

Enter Markdown on the left to see your TOC here.

Frequently Asked Questions

A Markdown Table of Contents (TOC) is a clickable, structured list of all headings in your Markdown document. It acts as a navigation hub, allowing readers to jump directly to any section with a single click. This is especially valuable for long README files, documentation, wikis, and technical guides on platforms like GitHub, GitLab, and Bitbucket. A well-crafted TOC improves readability, user experience, and even SEO on documentation sites.

Our generator follows GitHub Flavored Markdown anchor rules precisely: the heading text is lowercased, punctuation and special characters are stripped, spaces are converted to hyphens, multiple consecutive hyphens are collapsed into one, and leading/trailing hyphens are removed. Markdown formatting like **bold**, *italic*, `code`, and [links](url) is intelligently stripped from the anchor text. For duplicate headings, a sequential suffix (-1, -2, etc.) is appended automatically.

Yes, absolutely. This is a critical feature that many basic TOC tools overlook. Our parser correctly identifies fenced code blocks (marked with ```) and indented code blocks, ensuring that any # symbols appearing inside code snippets are not treated as headings. This prevents false entries from appearing in your generated TOC.

We support three numbering modes: None (clean, indented list with just links — great for READMEs), Numeric (flat sequential numbering: 1, 2, 3...), and Hierarchical (nested numbering like 1.1, 1.1.1, 2.1 — ideal for formal documentation and structured reports). You can also choose your preferred list marker: dash (-), asterisk (*), or plus (+).

Yes! Click the "Insert [TOC]" button to place a [TOC] marker at your cursor position in the input. After generating your TOC, you can copy it and replace the marker in your document. Some Markdown processors (like Typora and certain static site generators) can even auto-expand [TOC] or <!-- toc --> markers automatically.

Our generated anchors match GitHub's algorithm exactly. To ensure compatibility: (1) paste the generated TOC at the top of your Markdown file, (2) make sure your headings use consistent # syntax, (3) verify that heading text isn't excessively long (GitHub truncates very long anchor IDs). The TOC links will work perfectly on GitHub repositories, Gist, and GitHub Pages.

A Markdown TOC is written in pure Markdown syntax (using - [link](#anchor) format) and renders natively on any Markdown platform. An HTML TOC uses <ul> and <a> tags. Our tool generates Markdown-format TOCs, which are universally compatible, lightweight, and easy to edit manually if needed.

Yes! Our anchor generator preserves Unicode characters (including CJK, Cyrillic, Arabic, emoji, and accented characters) while still applying proper lowercasing for Latin scripts and sanitizing unsafe characters. This ensures your TOC works internationally on modern platforms that support Unicode anchors, including GitHub.