locates collisions that break GitHub deep links

Find duplicate heading anchors

Detect heading collisions that produce ambiguous GitHub URL fragments — then see exactly which suffix each duplicate will get.

Duplicate Headings
Input
93 B
15 lines
Output
178 B
11 lines
Status
ready
live
Ratio
1.91×
out/in
input · markdown
output · report
“Setup” (2×):
  line 1  →  #setup
  line 5  →  #setup-1

“Notes” (2×):
  line 9  →  #notes
  line 11  →  #notes-1

“Details” (2×):
  line 13  →  #details
  line 15  →  #details-1
Quick Start

How to find duplicate headings

Sluggifies each heading the GitHub way and groups by slug. Anything with more than one hit gets flagged, with the suffix each duplicate will receive.

  1. 01

    Paste Markdown

    Any document with headings.

    Parsing runs through marked with GFM extensions enabled — tables, task lists, strikethrough, and fenced code blocks all match GitHub’s rendering.

    inputGFMmarkedCommonMarklive
    input · markdownmd · GFM
    # Setup
    # Setup
    loaded · GFMGFM · ready
  2. 02

    Slugify all headings

    Apply GitHub's slug rules.

    Soft-break behaviour is configurable: by default a single newline becomes a space (CommonMark), toggle on for chat-style <br> insertion.

    slugsoft-breaksoptionsconfiglive
    slugs · optionsids · live
    setup, setup
    options applied · livelive
  3. 03

    Find collisions

    Any slug appearing 2+ times is reported with line numbers.

    The preview is scoped under a .mde class so its CSS doesn’t bleed into the rest of the page. Output HTML is whitespace-controlled for clean diffs.

    dupepreviewscoped CSSrenderstable
    out · renderedreport · ready
    #setup, #setup-1
    rendered · liverendered
  4. 04

    Rename or anchor

    Differentiate the headings or add explicit <a id> anchors.

    Export covers both raw Markdown and rendered HTML; downloads stream as text/markdown or text/html via Blob + object URL.

    fixclipboard.md.htmlblob
    ✓ · exportedfixed · done
    ✓ unique
    stable · ready to shipsuccess
Pro tips

Author Markdown that renders everywhere

GFM is the safe default

GitHub-Flavored Markdown is the de-facto baseline (tables, task lists, strikethrough). CommonMark is stricter but ubiquitous as a fallback.

Soft-break behaviour varies

A single newline is a space in CommonMark, a <br> in GFM. Toggle soft breaks when source matters.

Escape inside code fences

Backticks inside fenced blocks need a longer fence — three becomes four. Use ~~~ if your content has many backticks.

Anchors are slugified

GitHub lowercases, strips punctuation, and joins with hyphens. Duplicate headings get -1, -2 suffixes.

Tables need a header row

The dash row sets alignment (:---, :-:, ---:). Use Table Aligner for diff-friendly columns.

Front matter is YAML

Triple-dash blocks at the top of files are parsed by static-site generators. Use the Front-Matter Validator to catch syntax errors.

Use Cases

When to find duplicates

Stop links from silently pointing to the wrong section.

Long READMEs

Catch repeated section names in long single-file docs. Render path uses marked with GFM extensions enabled (tables, task lists, strikethrough, autolinks), so what you preview matches what GitHub publishes bit-for-bit. Soft-break behaviour is configurable for chat-style vs prose Markdown.

GFM-compliant

Merged docs

Spot collisions after concatenating multiple docs. Pairs cleanly with the Markdown Cheatsheet for syntax you can't quite remember — callout blocks, footnotes, definition lists. Output stays diff-friendly so style-only changes don't drown out real edits in PRs.

GitHub-perfect

Doc audits

Run before publishing a new release. Cross-platform safe: anchors, code fences, and tables behave identically on GitHub, GitLab, Bitbucket, and Gitea. Heading-anchor slugs follow GitHub's lowercase-and-hyphenate rules so deep links survive a docs migration.

diff-friendly

Cross-link safety

Confirm deep links resolve to the intended heading. No server roundtrip — perfect for proprietary content you can't paste into a public tool. The full marked + GFM bundle ships with the page, so it works offline once loaded.

render-stable

Refactor cleanup

After restructuring, ensure anchor URLs don't shift. Front matter (YAML / TOML / JSON) passes through unchanged so static-site pipelines (Jekyll, Hugo, Astro, Eleventy) read it correctly. Pair with the Front-Matter Validator to catch syntax errors before deploy.

cross-platform

Multi-author docs

Catch accidental duplicates in collaborative repos. Output is reproducible: identical input always produces identical Markdown, so doc-generation scripts can rely on it for snapshot tests and embedded into release workflows.

SEO-friendly
FAQ

Frequently asked questions

GitHub's — same as the Anchor Generator. Most modern Markdown renderers follow similar rules.
First occurrence keeps the base slug; subsequent ones get -1, -2, etc. The output shows the suffix each duplicate will receive.
Usually yes. Distinct section names are better UX and more grep-friendly than suffix anchors.
Yes — fenced code containing #-prefixed lines may produce false positives. Wrap genuine headings outside code.
No. Detection runs locally in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!