# Label in Name: Visible Text in the Accessible Name

Source: https://allyway.ai/glossary/label-in-name

Label in Name is WCAG success criterion 2.5.3 (Level A). For user interface components with labels that include text or images of text, the accessible name contains the text that is presented visually.

Label in name means that the words people see on a button, link or field are also part of the name that software reads. A button shows "Send", but its code says `aria-label="Submit form"` – a voice control user says "Click Send" and nothing happens. WCAG 2.5.3 closes that gap between visible label and accessible name.

## What it means

[WCAG 2.5.3 Label in Name](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html) is a Level A criterion: for user interface components with labels that include text or images of text, the name contains the text that is presented visually. The intent, in W3C's words: the words that visually label a component are also the words associated with it programmatically.

| Visible label | Accessible name | Result |
|---|---|---|
| Search | Search | Passes – name matches label |
| Search | Search for a value | Passes – name starts with the label |
| First Name: | Given name | Fails – different words |
| Send | Submit form | Fails – the visible word is missing |

W3C notes more details: capitalization and most punctuation are generally ignored, symbolic characters such as a "B" on a bold button are not labels, and components without a visible text label are out of scope. A placeholder counts as the label only when there is no other text nearby that serves as one.

Who benefits: people using voice control, who activate controls by saying the label they see, and [screen reader](https://allyway.ai/glossary/screen-reader) users who can see the screen, who hear names that match the text in front of them.

> **Tip:** > **Put the visible text first**
> W3C calls it a best practice to start the [accessible name](https://allyway.ai/glossary/accessible-name) with the label text. "Search for a value" works, but "Search" alone is even easier to match. The more words you add, the more you should ask whether you need them.

## Examples

```html title="Example"
<!-- Fails: aria-label replaces the visible text "Send" -->
<button type="submit" aria-label="Submit form">Send</button>

<!-- Passes: no aria-label, the visible text is the name -->
<button type="submit">Send</button>

<!-- Passes: the name starts with the visible text -->
<a href="/report.pdf" aria-label="Read more about the 2026 annual report">Read more</a>

<!-- Passes: the label element gives the field its name -->
<label for="email">Email address</label>
<input id="email" type="email" autocomplete="email">
```

The most common cause of failures is an [aria-label](https://allyway.ai/glossary/aria-label) that overrides the visible text. W3C advises care with `aria-label` and `aria-labelledby` when a visible label already exists. For fields, a real `<label>` element is the safest choice – see [form labels](https://allyway.ai/glossary/form-labels).

**Do:** Do

Let visible text be the name wherever you can, start any longer name with the exact visible words, keep abbreviations and formulas as they are written, and use a `<label>` element for every field.

**Don't:** Don't

Add an `aria-label` with different words to a button that already has text, label a link "Learn more" while its name says "Product details", or rewrite visible text in the name for "SEO".

## How to check label in name



## Questions

Q: What is the difference between a label and an accessible name?
A: The label is the text people see next to or on a control. The accessible name is what software, such as screen readers and voice control, uses to identify it. WCAG 2.5.3 asks that the name contains the visible label.

Q: Does the accessible name have to match the label exactly?
A: No. It must contain the visible text. W3C recommends matching where practical and starting the name with the label text when you add more words.

Q: Does case or punctuation matter?
A: Generally not. W3C notes that capitalization and most punctuation are ignored for this criterion, but recommends keeping capitals where they signal an abbreviation.

Q: Does Label in Name apply to icon buttons?
A: Not if the icon has no visible text. A button with only a symbol has no text label, so the criterion does not apply – it still needs a clear accessible name under other criteria.
