Markdown Anchor Generator
Generate anchor IDs for all headings in Markdown documents. Supports GitHub, GitLab, and custom slug conventions with duplicate handling and configurable prefixes.
🌈 Browse More Tools
Complete Guide: Markdown Anchor Generator
Everything you need to know about using this tool effectively
The Markdown Anchor Generator parses Markdown headings and creates anchor links for each one. It converts heading text to URL-safe slugs (lowercase, hyphens, no special characters) and generates the corresponding anchor link syntax. This is useful for creating table of contents or cross-references within a Markdown document. All processing happens in the browser.
This tool scans Markdown text for heading lines (lines starting with #), extracts the heading text, converts it to a slug by lowercasing and replacing spaces and special characters with hyphens, and outputs anchor link pairs [text](#slug).
Creating a table of contents
Generate anchor links from all headings for a clickable table of contents at the top of a document.
Cross-referencing sections
Create anchor links to specific sections within a long Markdown document.
Building documentation navigation
Generate navigation links for a documentation site built from Markdown files.
Migrating content to a CMS
Extract heading anchors for use in a content management system that supports anchor links.
Paste Markdown
Enter Markdown text containing headings.
Generate anchors
Click Generate. The tool extracts headings and creates anchor links.
Copy the anchors
Copy individual anchors or the full table of contents.
Anchor slugs are lowercase with hyphens replacing spaces.
GitHub and most Markdown processors use the same slug format.
Duplicate headings produce duplicate slugs. Some processors append -1, -2.
Use anchors in a table of contents for long documents.
What is an anchor link?
An anchor link is a link that jumps to a specific section within the same page. It uses the format [text](#slug) where slug is derived from the heading text.
How are slugs generated?
Heading text is lowercased, special characters are removed, and spaces are replaced with hyphens. For example, 'Getting Started' becomes 'getting-started'.
Is my content sent to a server?
No. All processing happens in your browser. Nothing is transmitted.
Does it work with GitHub Markdown?
Yes. The slug format matches GitHub's anchor generation algorithm.
Can I use anchors across documents?
Anchors work within a single page. For cross-document links, use the full URL with the anchor appended.