Skip to main contentOpen accessibility widget

ARIA labels: when to use them, and when not

What aria-label does, when to use it, and when a visible label is better.

Author avatar

Alen Velkov

Author

ARIA labels: a search icon button with an orange tag reading aria-label="Search" and a speech bubble saying "Search, button"

ARIA labels: when to use them (and when not to)

ARIA labels give an element a name that screen readers announce. Here is when they help, when they hurt, and how to test them.

Quick answer

An ARIA label sets the accessible name of an element: the name a screen reader announces. Use aria-label when there is no visible text to use, such as an icon-only button. Use aria-labelledby when the name is already on the page. If a native HTML option exists, like a <label> for a form field, use that instead. WCAG doesn't require ARIA; it requires that every control has a name and role that software can read (Success Criterion 4.1.2).

What is an ARIA label?

An ARIA label is an attribute that tells assistive technology what an element is called. It comes from WAI-ARIA, the W3C specification for accessibility information in web pages. Three attributes do most of the work:

AttributeWhat it doesExample
aria-labelSets the name with a text string that isn't shown on screen<button aria-label="Close">X</button>
aria-labelledbyUses the text of another element on the page as the nameA dialog named by its own heading
aria-describedbyAdds a description after the name, such as a hint or an errorA password field pointing to its rules

The name matters because it's how people who can't see the screen find and use a control. A button without a name is announced as just "button".

Does a screen reader read aria-label?

Yes. Screen readers announce the aria-label value as the element's name. What happens to the visible content depends on the element.

  • On buttons and links, aria-label replaces the text inside. W3C's naming guide says it "hides descendant content from assistive technology users and replaces it with the value of aria-label".
  • On most other elements, such as a <nav>, the screen reader announces the label and then the content. <nav aria-label="Product"> is announced as the "Product" navigation, followed by its links.

The label is invisible. Sighted users never see it, so a wrong or outdated label goes unnoticed unless someone tests with a screen reader. W3C also notes that aria-label values need translating when your site is translated.

Which label wins?

When an element has several possible names, browsers follow a fixed order. The W3C Accessible Name and Description Computation sets it. In simplified form:

  1. aria-labelledby
  2. aria-label
  3. The native label: <label> for form fields, alt for images, <caption> for tables
  4. The element's own text content, for buttons, links and similar roles
  5. The title attribute, as a last resort

So aria-label overrides a visible <label>. If the two say different things, screen reader users hear something different from what everyone else sees.

When to use ARIA labels

Use them when an element has no visible text that could serve as its name. Typical cases:

  • Icon-only buttons: a magnifying glass for search, an X to close, a hamburger menu. <button aria-label="Search"> gives them a name.
  • Several landmarks of the same type: two <nav> elements become "Main" and "Footer" navigation with aria-label.
  • Custom widgets named by on-page text: a switch or dialog whose name is already visible nearby. Use aria-labelledby and point to that text, so there's one source to update.
  • Extra context for a field: aria-describedby links a field to its format hint or error message.

When not to use ARIA labels

Don't use ARIA when native HTML already does the job. The first rule of ARIA, from W3C's Using ARIA, says: if a native HTML element or attribute has the semantics and behaviour you need, use it instead of adding ARIA. The common mistakes:

  • Replacing a visible label. A form field with a visible <label> doesn't need aria-label. W3C's naming guide says to prefer visible text: it's easier to maintain and helps people who don't use a screen reader.
  • A name that doesn't match the visible text. WCAG 2.2 Success Criterion 2.5.3 (Label in Name) requires the accessible name to contain the visible label. If a button says "Buy now" and its aria-label says "Add to basket", voice control users saying "click Buy now" can't operate it.
  • Labelling elements that can't be named. WAI-ARIA 1.2 doesn't allow aria-label on some roles, including generic (a plain <div> or <span>), paragraph, presentation, code, strong and emphasis.
  • Adding a role without the behaviour. <div role="button"> is, in W3C's words, "a promise". You also have to add keyboard focus and Enter and Space handling. A real <button> comes with all of that.
  • Hiding focusable elements. Don't put aria-hidden="true" or role="presentation" on something that can receive focus. Keyboard users land on it and hear nothing.

W3C's own advice sums it up: "No ARIA is better than bad ARIA."

Does WCAG require ARIA?

No. WCAG requires results, not a technique. Success Criterion 4.1.2 (Name, Role, Value) requires that for all user interface components "the name and role can be programmatically determined". Native HTML usually meets this on its own: a <button> with text, a <label> linked to its field, an image with alt.

ARIA is one way to meet it when native HTML can't, for example in custom widgets. Our complete guide to WCAG explains the success criteria and levels.

How to test your ARIA labels

Check the computed name, then listen to it.

  1. Browser developer tools. Inspect the element and open the Accessibility panel. It shows the computed name and role the browser passes to assistive technology.
  2. A screen reader. Tab through the page and listen. Is every control announced with a clear name and the right role?
  3. An automated scan. Our free accessibility checker flags controls with no accessible name. A scanner can tell that a name is missing, but not whether it makes sense, so the manual checks still matter.

For whole sites, accessibility monitoring catches new problems as your code changes, and an accessibility audit covers what scanners can't judge.

Accessible names are part of the accessibility tree, the structured view of a page that assistive technology reads. Our article on how AI models read your website covers why that structure matters beyond screen readers.

What this means for your team

  1. Start with native HTML. Use <button>, <label>, alt and <caption> before reaching for ARIA.
  2. Give every icon-only control a name. That's where aria-label belongs.
  3. Keep names consistent with what's on screen. The accessible name should contain the visible label.
  4. Fix ARIA in shared components. One fix in a button or icon component repairs every page that uses it.
  5. Test with the accessibility panel and a screen reader before release, not only with an automated scan.

Frequently asked questions

What does aria-label mean?

It's an attribute that gives an element an accessible name, the text a screen reader announces. It isn't shown on screen.

Does a screen reader read aria-label?

Yes. Screen readers announce it as the element's name. On buttons and links it replaces the visible text; on landmarks like <nav> it's announced together with the content.

What is the difference between aria-label and aria-labelledby?

aria-label takes a text string you write in the code. aria-labelledby points to text that's already on the page. If both are present, aria-labelledby wins.

Is aria-label required for WCAG?

No. WCAG requires every control to have a name and role that software can read (Success Criterion 4.1.2). Native HTML usually provides that; ARIA is only needed when it can't.

Can I use aria-label on a div?

Not on a plain <div>. WAI-ARIA 1.2 prohibits naming the generic role, which a plain <div> has. Give the <div> a role that supports a name, or better, use the native element.

Should aria-label match the visible text?

The accessible name should contain the visible label, ideally at the start. That's WCAG Success Criterion 2.5.3, and it lets voice control users activate the control by saying what they see.


Share this post

You might also like

Two more articles worth reading while this topic is still fresh.

Blog article

Run, Monitor and Report Accessibility Scans

Run accessibility scans, monitor your site and share reports in EaseAccess24.

Wordpress Integration cover image

WordPress Accessibility Widget: Install Guide

How to install the EaseAccess24 widget on WordPress: domain, key and script.