Markdown TOC Generator (Auto Table of Contents)
Generate a Table of Contents from markdown — GitHub-compatible anchor links. Strip diacritics, numbered list, checklist. Great for READMEs, docs, long blog posts.
Generate a Table of Contents from markdown — for READMEs, docs, long blog posts. Anchor links match GitHub/GitLab/Hugo/Astro slug rules.
When you need a TOC
- Project READMEs: long files → readers jump to the section they need.
- Docs sites: Astro/Docusaurus auto-generate TOCs, but GitLab/GitHub markdown does not — add manually.
- Long blog posts: 3000+ word articles — a TOC at the top helps navigation and dwell time (good for SEO).
- Notion / Obsidian: paste a markdown export — get an instant outline.
Anchor link rules
GitHub/GitLab convert headings into slugs:
- Everything lowercase.
- Spaces → hyphens.
- Strip special characters (
?!:...). - Strip diacritics — Vietnamese accents stay in the slug if you don't strip!
- Duplicate headings → add
-1,-2… suffixes.
Tips
- Strip Vietnamese diacritics: enable for clean ASCII slugs — works with GitHub and Hugo. E.g. "Cài đặt" →
#cai-dat(NOT#cài-đặt). - Min/max level: H2-H3 is usually enough. H1 is the post title → exclude. H4-H6 is too granular.
- Numbered + checklist: great for step-by-step tutorials (e.g. "Install", "Configure", "Run").
- Code blocks: the tool skips headings inside fenced code blocks
```— no false positives from# commentin code.
Who this is for
Content writers, editors, SEO specialists, devs handling text/markdown — URL slugs, char counts, regex testing, SQL formatting.
FAQ
Does this support Vietnamese diacritics?
Yes. All text tools fully support Vietnamese Unicode, including modern diacritic rules.
Is my pasted text saved?
No. Text only exists in the current tab. Refresh or close = gone. TopDev stores nothing.
Related tools
See all tools →Regex Tester
Test regex live with match highlighting. 7 ready presets including Vietnamese.
NEWRemove Vietnamese diacritics
Strip diacritics for slugs, filenames, usernames, identifiers. Optional đ → d.
NEWURL Slug Generator
Title → SEO-clean URL slug. Strip diacritics, lowercase, custom separator.
NEWChar / Word / Line Counter
Real-time char/word/line/paragraph count + SEO meta (60/160) and tweet (280) meters.