Skip to main content

2.5.3 Label in Name: what it requires and how to test it

When a button says "Search", its accessible name has to include "Search". Otherwise someone using speech input says what they see, and nothing happens.

Level A · Added in WCAG 2.1 · Last reviewed November 29, 2026

What 2.5.3 requires

For user interface components with labels that include text or images of text, the accessible name contains the text that is presented visually. The visible label is what's written on or next to the control. The accessible name is what assistive technology announces and what speech input matches against. The W3C notes that a best practice is to have the label's text at the start of the name. This is a plain-language summary. The normative text is in the W3C Recommendation, with the W3C's explanation in Understanding 2.5.3 (opens in a new tab) [1][2].

Exceptions and scope:

  • Only controls with a visible text label (or an image of text) are in scope. Icon-only controls are covered by 4.1.2 Name, Role, Value.
  • Contains, not equals. Extra words are allowed. "Read more about pricing" is a valid name for a link that shows "Read more".
  • Order matters in practice. The W3C lists a name whose words appear in a different order from the visible label, or with other words in between, as a potential failure [1].

Why it matters

People who use speech input, such as Voice Control on macOS and iOS or Dragon on Windows, operate a page by saying what they see: "Click Search", "Click Add to cart". The software looks for a control whose accessible name contains those words. If the "Search" button's name is "Submit query", the command fails, and the user has to fall back to slower methods such as numbered overlays or grids. Screen-reader users who can see some of the screen are also confused when the announcement doesn't match the label.

Common failures

aria-label that replaces the visible text

The button reads "Search" on screen, but aria-label overrides it. This is the W3C's documented failure F96 [3].

<!-- Fails: the name is "Submit query" -->
<button aria-label="Submit query">Search</button>

<!-- Better: the name comes from the visible text -->
<button>Search</button>

Visible label words reordered in the name

A link shows "Read more" but is named "More info: read the guide".

<!-- Risky: the visible words aren't in the name in the same order -->
<a href="/guide" aria-label="More info: read the guide">Read more</a>

<!-- Better: start with the visible text -->
<a href="/guide">Read more<span class="visually-hidden"> about the guide</span></a>

Field label that differs from its accessible name

The input sits under a visible "Email" label, but its name comes from a different, hidden label.

<!-- Fails -->
<span>Email</span>
<input aria-label="Your contact address">

<!-- Better -->
<label for="email">Email</label>
<input id="email" type="email">

Visible text with no accessible name at all

A control shows text but has no name, so neither speech nor screen readers can find it. The W3C's failure F111 covers this across 1.3.1, 2.5.3 and 4.1.2 [3].

Can automated testing check 2.5.3?

Barely. The rule engine our scans use has an experimental rule for this, and our default scans don't run experimental rules. A person comparing what's visible with what's announced is still the reliable test.

Automated ruleWhat it checks
(none in our default scans)Comparing the visible label with the accessible name needs the rendered text and the name side by side

What automation can't decide:

  • which visible text is the control's label, when the label sits beside the control rather than inside it
  • whether extra words in the name are reasonable or interrupt the visible label
  • whether an icon's visible text alternative counts as a label

A clean automated result is never proof that 2.5.3 is met. See why sites pass automated scans but fail real screen reader users.

How to test it by hand

  1. List the controls on the page that have visible text: buttons, links, form fields with labels, tabs and menu items.
  2. Inspect each one in the browser's accessibility panel and compare the accessible name with the visible text. Does the name contain the visible words, in the same order?
  3. Turn on Voice Control (macOS or iOS) or Windows Voice Access and say "Click" followed by each visible label. Does the right control respond?
  4. With a screen reader, Tab through the controls and listen. Does what you hear include what you see?
  5. Pay closest attention to controls with aria-label or aria-labelledby, where mismatches usually come from.

New to screen readers? Start with how to test a website with a screen reader.

How Accessible helps (and where it stops)

  • The screen reader transcript in the AI-assistant tools returns every control with the accessible name a screen reader announces, so you can compare names with labels without opening devtools.
  • The form fields check lists every field with the name a screen reader announces for it and flags fields with no accessible name.
  • Automated scanning flags controls with no accessible name at all under 4.1.2, which removes the worst case. It doesn't compare names with visible labels.

Where it stops: comparing what's shown with what's announced still needs a person. Check a page free to find controls with no name, and use free accessibility monitoring to see the barriers real visitors meet. No automated tool, ours included, can certify that a criterion is met.

Sources

  1. Understanding Success Criterion 2.5.3: Label in Name (opens in a new tab). W3C Web Accessibility Initiative. Accessed November 29, 2026.
  2. Web Content Accessibility Guidelines (WCAG) 2.2, Success Criterion 2.5.3 (opens in a new tab). W3C Recommendation. Accessed November 29, 2026.
  3. F96: Failure due to the accessible name not containing the visible label text (opens in a new tab) and F111: Failure due to a control with visible label text but no accessible name (opens in a new tab). W3C WCAG 2.2 Techniques. Accessed November 29, 2026.

Meeting a success criterion is not the same as legal compliance, which depends on the rules that apply to you. No automated tool can certify conformance.

Frequently asked questions

Does the accessible name have to match the label exactly?

No. It has to contain the visible label text. The W3C recommends putting the label text at the start of the name, so "Search products" is fine for a button that says "Search".

Does 2.5.3 apply to icon-only buttons?

No. It applies to controls with a visible text label or an image of text. An icon-only button still needs an accessible name under 4.1.2, and its name should match what people would call it.

Who is affected by a label mismatch?

Mostly speech-input users, who activate controls by saying their visible label. Screen-reader users who can see the screen are affected too, because what they hear doesn't match what they see.

Is aria-label always a 2.5.3 risk?

aria-label replaces the name a control would get from its visible text, so it's the most common cause of mismatches. If you use it on a control with visible text, make sure it contains that text, ideally at the start.

Hear what your buttons are really called.

Check a page free, then compare each control's visible label with the name a screen reader announces. Free accessibility monitoring shows the barriers real visitors hit, with no card and no expiry.