# Attribute “aria-hidden” is unnecessary for elements that have attribute “hidden”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/attribute-aria-hidden-is-unnecessary-for-elements-that-have-attribute-hidden
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `aria-hidden` attribute is redundant when the `hidden` attribute is already present on an element.

The `hidden` attribute is a boolean HTML attribute that makes an element not visible and not perceivable to any user. Browsers hide the element from rendering, and accessibility tools also ignore it. The `aria-hidden="true"` attribute does something narrower: it removes the element from the accessibility tree but does not affect visual rendering.

When both attributes appear on the same element, `aria-hidden` adds nothing. The `hidden` attribute already tells assistive technologies to skip the element. The validator flags this as unnecessary markup.

There is one subtle difference worth knowing. `aria-hidden="false"` on an element with `hidden` would create a contradiction: the element is hidden from everyone visually, yet exposed to assistive technologies. This is almost never intentional and likely a bug.

If the goal is to hide content from all users, use `hidden` alone. If the goal is to hide content only from assistive technologies while keeping it visible, use `aria-hidden="true"` alone without `hidden`.

## HTML examples

### Before fix

```html
<div hidden aria-hidden="true">
  <p>This content is hidden from everyone.</p>
</div>
```

### After fix

```html
<div hidden>
  <p>This content is hidden from everyone.</p>
</div>
```
