---
url: "https://webaim.org/articles/label-name/"
titulek: "WebAIM: Decoding Label and Name for Accessibility"
h1: "Decoding Label and Name for Accessibility"
popis: ""
jazyk: "en"
kanonicka: ""
drobecky: ["You are here:", "Home", "Articles"]
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-14 05:18:10"
znaku: 12691
slov: 2047
kodovani: "utf-8"
sha256: "4a0bba20606c769149ab8b8f9b4ba6026fe761c3711fdd22af358fdc05611b8a"
---
# Decoding Label and Name for Accessibility
You are here: [Home](/) > [Articles](/articles/) > Label and Name
## "Label" and "Name" as Defined in WCAG
The [Web Content Accessibility Guidelines](/standards/wcag/checklist) (WCAG) 2 require that interactive elements have a "label" and "name" (often called "accessible name"), but the way these terms are used in WCAG does not always match how they are used by developers.
WCAG defines an element's *label* as: "text or other component with a text alternative that is presented to a user to identify a component within Web content." It defines *name* as: "text by which software can identify a component within Web content to the user". These definitions are almost identical, but there is one important difference: "label" is presented to the **user** and "name" is presented to **software**.
In other words, *label* is presented visually, and *name* is presented to assistive technologies, like screen readers and voice control software.
## Label and Name are Usually the Same
For most HTML elements, the WCAG name and label should be the same. For example, if a link has text of "Apply now" (`Apply now`), this text will serve as both the label (what a sighted user sees) and name (what a screen reader user would hear).
However, finding the accessible name is not always straightforward, especially in one of these three scenarios:
1. For images, you must check the alternative text to discover the accessible name.
2. If an element has multiple bits of information competing for the accessible name, you must determine what rises to the top. This is especially common for form controls.
3. If an element uses ARIA labels ( `aria-label` or `aria-labelledby` ), this will override any other contender for accessible name, sometimes with disastrous results.
As an example of #1, a linked image presents the text "Next":
The WCAG label for this element is the visible text of "Next", but you cannot know the accessible name provided for this image just by looking at it.
Important
There are two primary ways to discover the accessible name:
1. Use a screen reader.
2. Inspected the underlying structure of the element. This is usually done by viewing the code or using developer tools that are built into the browser, such as Chrome Developer Tools.
The code for this image is ``. By using one of these two methods, we discover that the accessible name for this image is "Next"—the same information that is presented visually is presented to assistive technologies.
Note
Not every HTML element can have an accessible name. For example, ``, `
`, and `
` cannot (except in cases where certain ARIA roles are added to them).
## WCAG 2.1 "Label in Name"
What if this same linked image has alternative text of "Continue":
``?
WCAG 2.0 requires equivalent alternative text for images, and the word "Continue" is arguably equivalent to "Next", so you could make a case for this conforming with WCAG 2.0. But this mismatch between the visible text and alternative text still poses problems. A user of voice control software like Dragon would be unable to activate this link using the visible label. A blind user may encounter an impasse when a sighted colleague asks them to "click on Next," but they cannot find a link or button with that name. A screen reader user who is not blind might be confused when they see "Next" but hear "Continue".
WCAG 2.1 addresses this issue with a Level A success criterion: "[2.5.3 - Label in Name](https://www.w3.org/TR/WCAG21/#label-in-name)". Label in Name requires that the accessible *name* for a link or control contain the text *label*. An image with visible text of "Next" and alternative text of "Continue" would fail this requirement.
The label and name do not have to match exactly. Alternative text of "Next Page" would meet the Label in Name requirement because the accessible name *contains* the visible label (although a perfect match of "Next" would almost certainly be better).
Note
This success criterion only applies when the element contains text or images of text—it would not apply to an image of an arrow with no text.
## Accessible Name Computation
An interactive element can only present one string of information as the accessible name, but there can be numerous bits of information competing for this spot. For example, the accessible name for a textbox (``) could come from the `