Operable · Input Modalities

WCAG 2.5.3 Label in Name Explained in Plain English

WCAG 2.5.3 Label in Name explained simply: why a control’s accessible name must contain its visible text, how voice control relies on it and how to test.

2.5.3 Level A Added in WCAG 2.1 Needs manual review

Illustration: a speech bubble icon, with 2.5.3 and Label in Name
Table of contents

2.5.3 Label in Name is the WCAG success criterion that says the name a control has in the code must include the words people can see on it. If a button says “Search”, its accessible name must contain “Search”. This matters most for voice control users, who say what they see, “Click Search”, to press a button. This guide explains WCAG 2.5.3 Label in Name in plain English, the common mistakes and how to test.

The official wording: “For user interface components with labels that include text or images of text, the name contains the text that is presented visually.” (W3C, WCAG 2.2)

What Is 2.5.3 Label in Name?

2.5.3 Label in Name is a Level A requirement under the Operable principle, in the guideline “Input Modalities”, added in WCAG 2.1. Every control has an accessible name that assistive technology announces and uses. Normally it comes from the visible text, so it matches. Problems start when developers add aria-label or aria-labelledby, which replace the visible text as the name, and write something different.

Two Search buttons. In the failing one the code has aria-label Find items; a voice control user says Click Search and nothing happens. In the passing one the code has aria-label Search products; the user says Click Search and the button is pressed.
Voice control matches what people say against the accessible name, not the visible text.

Why 2.5.3 Label in Name Matters

Voice control software, such as Voice Control on Mac and iPhone, Voice Access on Android and Dragon on Windows, lets people operate a page by speaking. They read a control’s visible label and say it. If the accessible name is different, the command does not match and nothing happens.

It matters for screen reader users who can see the screen too, such as people with low vision or dyslexia. If they hear “Find items” while looking at a button that says “Search”, the page feels inconsistent and confusing.

Who Is Affected by 2.5.3 Label in Name

  • People who use voice control because of motor disabilities, repetitive strain injury or temporary injury
  • Screen reader users who can also see the screen
  • People with cognitive disabilities who rely on consistent labels

How to Meet 2.5.3 Label in Name

Let the visible text be the name

The simplest fix is to not override the name at all. A button with text, a link with text and an input with a label element all get their accessible name from that visible text automatically. Only add ARIA naming when you need to add information.

If you add words, include the visible text, ideally first

Three Buy now buttons with different accessible names. Buy now, 2-person tent is best. 2-person tent, buy now passes but is not ideal. Purchase fails because it does not contain the visible text.
The name must contain the visible text. Starting with it works best for voice control.

The W3C techniques G208, including the text of the visible label as part of the accessible name and G211, matching the accessible name to the visible label describe the fix. An accessible name that does not contain the visible label is failure F96.

<!-- Fails: name does not contain "Search" -->
<button aria-label="Find items">Search</button>

<!-- Passes: visible text first, extra context after -->
<button aria-label="Search products">Search</button>

<!-- Passes: visible text plus context from the page -->
<h3 id="tent">2-person tent</h3>
<button id="buy" aria-labelledby="buy tent">Buy now</button>

Watch for form labels that differ from placeholders

If a field has a visible label, the accessible name should come from that label. Do not label it with aria-label text that differs from what people see.

Ignore punctuation and capitalization

Matching is about the words. “Search” and “search” match, and so do “Next ›” and “Next”. Symbols that are not words, such as arrows, do not need to be in the name.

How to Test for 2.5.3 Label in Name

  1. Inspect each control with your browser’s accessibility panel and compare the accessible name with the visible text.
  2. Look for aria-label and aria-labelledby in your code. Each one is a place the name and label can drift apart.
  3. Try voice control. Say “Click” followed by the visible text of buttons and links. Each should work.
  4. Listen with a screen reader while looking at the screen. What you hear should match what you see.

Run a free WCAG scan to compare accessible names with visible labels on any page, then test with voice control.

Testing WCAG 2.5.3 With AccessBell

This criterion depends on meaning or context, so it needs a person to judge. AccessBell's report lists it for manual review rather than marking it pass or fail automatically, so it is not missed.

Run a free scan to spot issues on your own pages.

Frequently Asked Questions

What level is WCAG 2.5.3 Label in Name?

Level A. It was added in WCAG 2.1, so it applies to WCAG 2.1 and 2.2 targets.

What is an accessible name?

The name assistive technology uses for a control. It usually comes from the visible text or label, but aria-label and aria-labelledby replace it. 2.5.3 Label in Name is about making sure that replacement still contains the visible words.

Does the accessible name have to match the label exactly?

No. It must contain the visible text. Extra words are allowed, and the W3C recommends putting the visible text first, so "Buy now, 2-person tent" is better than "2-person tent, buy now".

Does 2.5.3 apply to icon-only buttons?

Not directly. It applies to controls whose label includes text or images of text. An icon-only button has no visible text to match, though it still needs an accessible name under 4.1.2 Name, Role, Value.

Can AccessBell test WCAG 2.5.3 automatically?

Not fully. This criterion needs a person to judge, so AccessBell's report lists it for manual review rather than marking it pass or fail on its own.

Sources

This page explains a technical standard and is not legal advice. See our disclaimer.

About the Author

Anton StewartAuthor

Contributor, AccessBell

Anton Stewart writes and reviews accessibility guides for the AccessBell blog, checked against the W3C standards and other primary sources.

How we reviewed this page
  1. Current version

    First published. Checked against the W3C WCAG 2.2 Recommendation, the Understanding document for 2.5.3 Label in Name and the W3C techniques it lists.

Check Your Site Against WCAG 2.5.3

Run a free scan to spot 2.5.3 Label in Name issues and every other automated WCAG check, then get help fixing them.

Pro is a 3-day free trial, then $29 per domain per month or $199 per year. You add a card at checkout and are not charged until the trial ends. Cancel before then and you will not be charged.

Not ready for a subscription? A Page Report is $19 for one page, and a Domain Audit is $79 for up to 500 pages.