ARIA IDs are unique

Each element has a unique ID so screen readers can reference it correctly.

On this page

Impact

ScanGov impact ratings

About

The value of an ARIA ID must be unique to prevent other instances from being overlooked by assistive technologies. [Learn how to fix duplicate ARIA IDs](https://dequeuniversity.com/rules/axe/4.10/duplicate-id-aria).

Risks

Screen readers reference the wrong element when IDs are duplicated.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: duplicate id referenced by aria-labelledby -->
<h2 id="title">Section one</h2>
<h2 id="title">Section two</h2>
<div aria-labelledby="title">...</div>

Passing pattern:

<!-- Pass: unique ids -->
<h2 id="title-one">Section one</h2>
<h2 id="title-two">Section two</h2>
<div aria-labelledby="title-one">...</div>

Error

ScanGov messaging when a site fails a standard:

Failed: ARIA IDs are unique

Guidance

Indicators

On this page