---
title: "Duplicate id (a11y/dup-id)"
description: "With the same id twice in one render, labels, aria references and focus land on the first element only."
url: http://localhost:4173/rules/a11y/dup-id
updated: 2026-11-11
---

# Duplicate id

> `a11y/dup-id` is a vetd rule. It flags: Duplicate id. It runs on every `check`, together with the TypeScript check.

| Fact | Value |
| --- | --- |
| Rule id | `a11y/dup-id` |
| Severity | warning |
| Group | Accessibility |
| Tags | accessibility, correctness |

## Why it matters

With the same id twice in one render, labels, aria references and focus land on the first element only.

## How to fix it

Make each id unique, e.g. with useId().

## Credit

Based on work by:

- [Deque](https://www.deque.com): The axe rules duplicate-id and duplicate-id-aria require id values referenced by labels and ARIA to be unique.

## References

- [id attribute value must be unique](https://dequeuniversity.com/rules/axe/4.10/duplicate-id), Deque University
- [IDs used in ARIA and labels must be unique](https://dequeuniversity.com/rules/axe/4.10/duplicate-id-aria), Deque University
- [id HTML global attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/id), MDN Web Docs

## Related rules

- [`a11y/form-label`](http://localhost:4173/rules/a11y/form-label.md)
- [`a11y/aria-hidden-focus`](http://localhost:4173/rules/a11y/aria-hidden-focus.md)

## Get this text from vetd

MCP: call `explain` with `{ "diagnosticId": "a11y/dup-id" }`. CLI: `npx vetd explain a11y/dup-id`.

---

[All 92 rules](http://localhost:4173/rules.md) · Previous: [`a11y/heading-skip`](http://localhost:4173/rules/a11y/heading-skip.md) · Next: [`bp/document-write`](http://localhost:4173/rules/bp/document-write.md)
