Which accessible name wins?

Accessible Name Wars: paste HTML and follow the label the browser chooses.

Up to 4 KB. Your markup is parsed, never rendered. Scripts and resources in it do not run or load. Only Copy link puts HTML in the URL; links are not encrypted.

The name is "Search"

Roughly announced as: Search, search text field.

Exact wording, role exposure, state announcements, and order vary by browser and screen reader.

HTML source
Show selected element as source
<input id="q" type="search" aria-label="Search" placeholder="Type a selector" title="Search tools">

Which source wins?

  1. 2A: hiddenSkipped

    This node is not hidden by the supported markup rules.

  2. 2B: aria-labelledbySkipped

    There is no aria-labelledby reference.

  3. 2C: embedded controlSkipped

    This node is not a value-bearing control embedded in another label.

  4. 2D: aria-labelUsed

    aria-label supplies "Search".

  5. 2E: label[for]Not reached

    The aria-label step already determined the result.

  6. 2F: contentNot reached

    The aria-label step already determined the result.

  7. 2H: recursive contentNot reached

    The aria-label step already determined the result.

  8. 2I: titleNot reached

    The aria-label step already determined the result.

  9. 2E: placeholderNot reached

    The aria-label step already determined the result.

  10. 2E: aria-placeholderNot reached

    The aria-label step already determined the result.

Description

Search tools

Show description computation
  1. description-1: aria-describedbySkipped

    There are no valid aria-describedby references.

  2. description-2: aria-descriptionSkipped

    There is no aria-description.

  3. description-3: native descriptionSkipped

    There is no unused native description source.

  4. description-4: titleUsed

    title supplies "Search tools".

Checks and fixes

  • The visible label "Search the lab" is not contained in the name "Search".

    WCAG 2.5.3

    Keep the visible wording in the accessible name, preferably at the start; verify symbolic text and visual context manually.

    <button aria-label="Search the lab">Search</button>

An accessible name identifies an element; a description adds context. A screen reader can combine the name with its role and state. The wording depends on the reader and platform, not just the HTML. See the accessible name specification.

Follow the order, then the exceptions

For an element that permits naming, aria-labelledby is checked before aria-label, followed by native labels such as label, alt, legend, and caption. Roles such as button and link can then use their content. A title can be a fallback; supported text fields can finally use a placeholder. An empty naming source can fall through, except where the element-specific rules say otherwise. Read the computation steps and HTML's element-specific rules.

A hidden element is normally excluded, but a directly referenced hidden label can contribute its hidden subtree. A control embedded in another label contributes its value. A generic container cannot simply be given a name with ARIA. These are algorithm rules, not a universal attribute ranking. See hidden labels, embedded controls, and roles that prohibit naming.

Keep what people see in what they hear

A competing ARIA label can replace a perfectly useful visible label. Voice-control users need the visible wording in the accessible name. Case and ordinary punctuation do not have to match. Symbolic characters and surrounding visual context need human review. See WCAG 2.5.3: Label in Name .

Names and descriptions have different rules

Descriptions check aria-describedby, then aria-description, unused native description sources, and finally an unused title. The first applicable description source wins even if it is empty. A figcaption does not automatically name its figure; reference it explicitly when appropriate. See description precedence and figure naming .

What pasted HTML cannot tell us

This tool reads attributes and text, not the rendered page. It recognizes hidden, aria-hidden="true", and inline hiding styles. It cannot know class-based styling, generated text, layout-dependent whitespace, shadow-tree changes, or values changed by scripts. Browser-generated button labels are shown in English and can be localized by a real browser. Always verify the final page with your browser and assistive technology. See rendered and generated content.