Glossary
/
What is aria-label?

What is aria-label?

The aria-label attribute is part of WAI-ARIA, the Web Accessibility Initiative's Accessible Rich Internet Applications spec. It enables you to set an accessible name for an HTML element directly in the markup, without adding any visible text to the page.

Screen readers announce the aria-label attribute's value instead of an element's visible text or content, making it useful for buttons, icons, and other interactive elements that don't have a visible label.

At a glance

Type ARIA attribute (global)
Related standard WAI-ARIA 1.2, WCAG 2.2 – Technique ARIA6
Common aliases ARIA label, ARIA label attribute, aria-label
Related terms aria-labelledby, accessible name, ARIA attributes

Why is aria-label important when it comes to accessibility?

Every interactive element on a page needs an accessible name so assistive technologies can tell users what it does. Sighted users get this information from visible text, icons, images, and layout. Screen reader users get it from the accessibility tree: a structured representation of the page that browsers build for assistive technologies to read.

When an element's visible label is missing, unclear, or purely decorative, the aria-label attribute makes it understandable to users of assistive technology.

A search icon with no text next to it means nothing to a screen reader unless something in the markup describes its function. Without an aria-label attribute or another way to provide labels, screen reader users hear nothing more than "button" and have to guess what the button actually does.

When it comes to form controls, icon-only buttons, and navigation menus, where visual design often favors compact icons over descriptive text, aria-label attributes are especially necessary, having a considerable impact on how usable a site is for screen reader users.

Using the aria-label attribute, you can improve web accessibility without changing a page's visual design. You can describe an element's purpose for assistive technologies while leaving the layout, spacing, text, and icon choices exactly as a design team intended.

Unsurprisingly, it’s one of the most commonly used ARIA attributes.

How does aria-label work?

An aria-label attribute overrides an element's default accessible name. If a <button> already has visible text content, that text is normally its accessible name. Add an aria-label attribute, and the value you provide takes over instead, keeping the original text content visible on the page.

This override only affects what assistive technologies announce. It changes nothing about how the element looks, so aria-label text never appears visually and never gets picked up by browser text search or copy-paste.

The browser follows a set order when it works out an element's accessible name: aria-labelledby takes priority first, aria-label comes next, then any native HTML labeling method such as a <label> element or alt attribute, and the title attribute is used last as a fallback.

Adding an aria-label attribute to an element that already has a proper native label, such as a form input already tied to a <label>, simply replaces a label that was already working.

The aria-label attribute can be added to most HTML elements, though it only has an effect on elements with a role that supports an accessible name, such as buttons, links, and form inputs.

Adding it to a plain <div> or <span> with no ARIA role attached often does nothing, since many assistive technologies ignore the accessible name of elements that don’t have a meaningful role in the accessibility tree.

An aria-label example

A common use case is an icon-only button, such as a search icon with no visible label text:

<button aria-label="Search">
  <svg aria-hidden="true" focusable="false">
    <!-- magnifying glass icon -->
  </svg>
</button>

Here, the SVG icon is marked aria-hidden="true" so it's invisible to the accessibility tree, and the aria-label attribute on the button supplies the accessible name to assistive technology.

A screen reader announces this as "Search, button," even though no text label is visible on the page. Without the aria-label attribute, the same element would announce only as "button," leaving its function undefined for anyone who can't see the search icon.

aria-label vs. alt text

Both the aria-label and alt attributes provide a text alternative to assistive technologies, but they aren't interchangeable.

aria-label alt attribute
Applies to Most HTML elements with an ARIA role, e.g., buttons, links, form fields <img>, <area>, and <input type="image"> only
Visible fallback Never rendered Displays if the image fails to load
Decorative content No direct equivalent – use aria-hidden="true" or role="presentation" instead Empty alt="" marks an image as decorative
Spec WAI-ARIA (World Wide Web Consortium) Native HTML
Used by search bots No Yes

As a rule, use the alt attribute for images and use an aria-labelattribute for interactive elements and icons that native HTML has no built-in way to label.

Common mistakes or misconceptions

  • Labeling elements with no role. Adding aria-label to a <div> or <span> without a role attached is unnecessary, as the element has no accessible name to begin with, at least as far as most assistive technologies are concerned.
  • Overriding a working visible label. If an element's visible text already describes its function clearly, adding an aria-label attribute on top will just duplicate or contradict it. You also risk creating a mismatch that trips up voice control users, who typically say the visible text label to activate an element, not any hidden aria-label text.
  • Using aria-label as a styling shortcut. Don’t use the aria-label attribute to hide a label visually, as you will make your web page less accessible. Doing this still leaves out users with cognitive disabilities and voice control users who rely on visible label text.
  • Keep the label visible wherever possible. If it genuinely can't be shown, a visually hidden native <label> is more robust than an aria-label.
  • Forgetting translation and localization. Because aria-label text isn't visible content, some automated translation and browser localization tools skip over it, leaving screen reader users on translated sites with an accessible name in the wrong language. Use aria-label sparingly, and check translated pages specifically for this.

Frequently Asked Questions

Does aria-label work in every browser?

Yes. Support for the aria-label attribute is consistent across all modern browsers and major screen readers, including NVDA, JAWS, and VoiceOver. It's one of the most widely supported ARIA attributes in current use.

Is aria-label the same as aria-labelledby?

No. The aria-label attribute takes a text string written directly into the HTML attribute, while aria-labelledby points to the ID of another element on the page and uses that element's text content as the accessible name. Use aria-labelledby when a suitable text label already exists elsewhere on the page, and use an aria-label attribute when no such text exists.

Should I use aria-label or aria-describedby?

Use an aria-label attribute for an element's name – what it is or does, announced first. Use the aria-describedby attribute for extra, supplementary detail – announced after the name, similar to a hint or additional instructions.

For example, a search field might use aria-label for "Search," and aria-describedby to point to a nearby note explaining what the search covers.

How do I choose meaningful aria-label text?

Write the aria-label attribute's value the way you'd describe the element's function out loud to someone who can't see it. Keep it short and specific, e.g., "Close dialog" rather than "Close," and match the wording a sighted user would expect from the surrounding page.

Skip the element's role or type, since screen readers announce that separately. If a visible label would work just as well, use that instead of hidden text.

What are the best practices for writing a descriptive aria-label?

Only add an aria-label attribute to elements whose role supports an accessible name, and keep extra context or instructions out of it – that belongs in aria-describedby. Use it sparingly, and listen to how a screen reader actually announces it before shipping; wording that reads well on screen doesn't always sound right aloud.

How do I use the aria-label attribute for better accessibility?

Add an aria-label attribute wherever an interactive element, such as an icon-only button or an unlabeled form field, has no visible text that a screen reader can already read.

Pair it with aria-hidden="true" on any decorative icon inside the element so assistive technologies don't announce redundant content, and leave elements that already have clear visible text alone.

Try our website monitor free

Automate website monitoring tasks
and keep your pages compliant