Markdown Anchor ID Generator

Add {#custom-id} anchor IDs to every heading. Useful for cross-references and deep linking.

0 anchors added

Summary — What Free Markdown Anchor ID Generator Does

What This Free Tool Is

Free Markdown Anchor ID Generator appends {#slug} anchor IDs to every heading in a Markdown document. Slugs follow GitHub's auto-ID conventions (lowercase, hyphenated, deduplicated). Useful for cross-references, deep linking, and table-of-contents generators that need explicit IDs.

Privacy: This tool runs entirely in your browser. Your text is never uploaded, logged, or cached. Close the tab and it's gone. Verify in DevTools → Network: zero requests fire.

Why It's Free (And How We Keep It Free)

Writing {#my-heading-slug} by hand for every heading in a long document is tedious and error-prone. This tool generates all of them in one pass, for free.

Table of Use

At-a-Glance Reference

InputOutputTypical sizeSpeedLogin needed
Markdown (.md)Markdown with anchor IDsUp to 5 MB< 50 msNo

Markdown Anchor ID Generator Features

Here's what this free tool does in detail — every feature is built to solve real problems, runs entirely in your browser, and is free forever.

GitHub-Compatible Slug Generation

Slugs are generated using GitHub's convention: heading text is lowercased, non-alphanumeric characters are stripped, spaces become hyphens, and consecutive hyphens are collapsed. The result matches what GitHub auto-generates for anchored headings, so your cross-references work on GitHub too.

To generate a full table of contents from the anchored headings, use the Free Markdown TOC Generator.

Duplicate Heading Deduplication

When two headings produce the same slug (e.g., two ## Getting Started sections), the tool appends a numeric suffix: {#getting-started} for the first, {#getting-started-1} for the second. This matches GitHub's deduplication behavior.

For numbering headings with hierarchical prefixes, use the Free Markdown Auto-Number Headings tool.

Optional Prefix

Add a custom prefix to every generated slug. For example, prefix doc- produces {#doc-getting-started}. Useful for namespacing anchors when multiple documents are combined into one page.

For finding and replacing existing anchor IDs across a document, use Free Markdown Find & Replace.

Overwrite or Skip Existing Anchors

By default, headings that already have a {#id} attribute are skipped. Toggle Overwrite to regenerate all anchor IDs from scratch, replacing any existing custom IDs with auto-generated ones.

To shift heading levels before generating anchors, use the Free Markdown Heading Shifter.

How To Use Free Markdown Anchor ID Generator

Step 1 — Paste your Markdown

Drop a document with headings into the input. Click Load example for a typical multi-section doc.

Step 2 — Choose style and options

Pick GitHub or custom-attr style. Add a prefix if needed. Toggle overwrite to replace existing anchors.

Step 3 — Copy the anchored output

Every heading now has a {#slug} anchor ID. Use them for cross-references, deep links, or TOC generation.

Who Can Use This Tool

Documentation authors

Add explicit anchor IDs to every heading for reliable cross-references across pages.

Static site builders

Generate anchor IDs for Hugo, Jekyll, or Astro docs that require explicit heading slugs.

Technical writers building specs

Add namespaced anchors to RFC-style documents for precise section linking.

Wiki maintainers

Generate consistent heading anchors before importing Markdown into Confluence or Notion.

Developers writing API docs

Add deep-link anchors to every endpoint section for easy sharing.

Frequently Asked Questions

Is this Anchor ID Generator free?

Yes. Free forever, no account required.

What is an anchor ID?

A slug like {#getting-started} appended to a heading, enabling direct links via #getting-started in the URL.

How are duplicate headings handled?

They get a numeric suffix: {#getting-started}, {#getting-started-1}, etc.

Does it overwrite existing IDs?

Not by default. Toggle Overwrite to regenerate all anchors from scratch.

What renderers support {#id} anchors?

Pandoc, Hugo, Jekyll, Astro, and many static site generators. GitHub renders them in some contexts.

Is my Markdown uploaded?

No. Runs 100% in your browser.

Related Free Markdown Tools