IDs referenced by ARIA and labels must be unique
Any id that a label, aria-labelledby, aria-describedby or another ARIA reference points to must appear only once on the page, so assistive technology connects the right elements.
| Rule ID | duplicate-id-aria |
|---|---|
| Impact | Critical |
| Success criterion | 4.1.2 Name, Role, Value · A |
| Standards | WCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549 |
| Needs a change in the website’s code |
Example
<label for="qty">Adults</label>
<input id="qty" type="number">
<label for="qty">Children</label>
<input id="qty" type="number">The second field is announced as "edit, number" with no label; clicking "Children" focuses the adults field.
<label for="qty-adults">Adults</label>
<input id="qty-adults" type="number">
<label for="qty-children">Children</label>
<input id="qty-children" type="number">Each field is announced with its own label: "Adults" and "Children".
Why it matters
Labels and ARIA attributes connect elements through their id. When two elements share an id, browsers use the first one and ignore the rest. A screen reader user then hears the wrong label, no label at all, or a description that belongs to another field. In a booking form with several identical rows, this makes it impossible to know which field you are in.
Sighted mouse users are affected too: clicking a label moves focus to the wrong field.
Duplicates usually come from copied templates, repeated components (cards, modals, cart rows) or widgets that render twice for mobile and desktop.
How to fix it
Give every referenced element a unique id, and update the references to match.
Repeated components. Add the row or item number, or a record id, to each id:
<div class="cart-row">
<span id="name-1042">Linen shirt</span>
<button aria-labelledby="remove-1042 name-1042" id="remove-1042">Remove</button>
</div>
Fields wrapped in their label do not need an id at all:
<label>Children <input type="number"></label>
Mobile and desktop copies. If the same form is rendered twice and one copy is hidden with CSS, render it only once, or prefix the ids (m-email, d-email).
Frameworks. Generate ids instead of hard-coding them: useId() in React, a counter in your template engine, or the component instance id in Vue or Svelte.
After fixing, check that every for, aria-labelledby, aria-describedby, aria-controls and aria-owns value matches exactly one element.
Checklist
- Make every id used by a label or ARIA attribute unique.
- Add a record id or index to ids in repeated components.
- Generate ids in components instead of hard-coding them.
- Update all references after renaming an id.
How the check works
The check finds elements whose id is referenced by a label for or by an ARIA attribute such as aria-labelledby or aria-describedby. It flags the id when another element on the page uses the same value. Because the effect depends on which element the browser picks, the result is marked for review: confirm that each reference reaches the intended element.
Resources
Updated October 27, 2026