aria-label
aria-label is an ARIA attribute that provides an accessible text name for an element, used when visible text is not available or sufficient to describe the element's purpose to assistive technology users.
In simple terms: aria-label is like a secret name tag that only screen readers can see. If a button just shows an X but you want the screen reader to say 'close,' you give it an aria-label that says 'close.'
What Is aria-label?
`aria-label` is a WAI-ARIA attribute that assigns a text string as the accessible name of an element. The accessible name is what screen readers announce when a user navigates to an element. While most elements get their accessible name from visible content, such as the text inside a button or the label associated with an input, `aria-label` provides a way to define that name when visible text is absent or inadequate. The attribute accepts a plain text string value. For example, `aria-label="Search"` on a magnifying glass icon button tells screen readers to announce "Search button" even though no visible text exists on the button. The label is invisible to sighted users but fully available to assistive technologies. `aria-label` is one of several mechanisms for providing accessible names. Others include the `<label>` element, `aria-labelledby`, and the element's own text content. The accessible name computation algorithm in the ARIA specification defines the priority order when multiple naming mechanisms are present.
Why It Matters
Every interactive element on a web page needs an accessible name. Without one, screen reader users hear only the element's role, such as "button" or "link," with no indication of what the element does. This makes the interface nearly impossible to navigate. WCAG Success Criterion 4.1.2 (Name, Role, Value) requires that all user interface components have a name that can be programmatically determined. Success Criterion 1.1.1 (Non-text Content) requires text alternatives for non-text content. `aria-label` directly addresses both criteria for elements that lack visible text labels. Common scenarios where `aria-label` is necessary include icon-only buttons (hamburger menus, close buttons, social media links), multiple navigation landmarks that need differentiation (e.g., "Main navigation" versus "Footer navigation"), and search inputs that rely on placeholder text instead of a visible label.
How It Works
Using `aria-label` is as simple as adding the attribute with a descriptive string: ```html <!-- Icon-only button --> <button aria-label="Close dialog"> <svg aria-hidden="true"><!-- X icon --></svg> </button> <!-- Distinguishing multiple nav landmarks --> <nav aria-label="Main navigation">...</nav> <nav aria-label="Footer navigation">...</nav> <!-- Search input without visible label --> <input type="search" aria-label="Search articles" placeholder="Search..."> ``` There are important rules and best practices to follow: **Use it on the right elements.** `aria-label` works on interactive elements (buttons, links, inputs) and elements with explicit ARIA roles. It does not work reliably on generic elements like `<div>` or `<span>` without roles. **Keep labels concise.** An `aria-label` should be brief and descriptive. "Close" is better than "Click this button to close the dialog window." Screen reader users expect short, action-oriented labels. **Don't duplicate visible text.** If a button already shows the text "Submit," adding `aria-label="Submit"` is redundant. Worse, if the `aria-label` says something different from the visible text, it creates a mismatch that confuses both screen reader users and voice control users who may speak the visible label. **Prefer visible labels.** The first rule of `aria-label` is to ask whether a visible label could work instead. Visible labels benefit everyone, including users with cognitive disabilities, users on small screens, and users who are simply unfamiliar with icon conventions. **Consider localization.** `aria-label` values are plain strings, not references to content in the DOM. This means they must be translated separately if your site supports multiple languages. Using `aria-labelledby` to reference visible translated text can be a more maintainable approach. **Interaction with aria-labelledby.** When both `aria-label` and `aria-labelledby` are present, `aria-labelledby` takes priority in the accessible name computation. This is defined by the accessible name and description computation specification.
Frequently Asked Questions
- When should I use aria-label versus a visible label?
- Always prefer a visible label because it benefits all users, not just assistive technology users. Use aria-label only when a visible label is not practical, such as for icon-only buttons, close buttons, or navigation landmarks that need differentiation.
- Does aria-label override visible text?
- Yes. When aria-label is applied to an element that also contains visible text, screen readers will announce the aria-label value instead of the visible text. This can cause confusion if the aria-label differs significantly from what's displayed.
- Can I use aria-label on any HTML element?
- aria-label only works on interactive elements (like buttons, links, and inputs) and elements with ARIA roles. Using it on static elements like a plain div or span without a role will be ignored by most assistive technologies.
Need help making your website ADA compliant?
Our team specializes in ADA-compliant web design and remediation. Get a free accessibility audit today.
Last updated: 2026-03-15