Every interactive control needs a name that assistive technology can announce. If a button is just an icon with no label, a screen reader announces only “button” and the user has no idea what it does. This tool reproduces the browser’s own name-computation algorithm so you can verify the announced name from a pasted snippet, without firing up a full screen reader.
How it works
The tool parses your snippet with the browser’s built-in HTML parser, finds the first interactive element (or any element with a role), and walks the W3C Accessible Name and Description Computation in precedence order. The first step that yields a non-empty string wins.
- aria-labelledby — the text of each referenced element id is collected and joined in order. This overrides everything else.
- aria-label — if present and non-empty, its trimmed value is used.
- Native semantics — depends on the element:
- Form fields (
input,textarea,select) use an associatedlabel(via wrapping orfor), thenplaceholder, then a buttonvalue. - Images and image areas use the
altattribute. - Buttons, links, summaries and table cells use their own text content.
- Form fields (
- title — used only as a weak fallback tooltip when nothing above produced a name.
If no rule produces text, the element has no accessible name, which is reported as an error because such a control is effectively unusable with a screen reader.
Example
Given this snippet:
<button aria-label="Close dialog" class="x">×</button>
The visible content is just a multiplication sign, but aria-label wins at step 2, so the computed accessible name is Close dialog. Remove the aria-label and the name falls back to the symbol character, which a screen reader would announce unhelpfully as “times” or nothing useful.
Notes and limitations
- This implements a practical subset of the spec covering the common 95 percent of real elements. It does not resolve cross-document references, CSS generated content, or the full recursive traversal for complex nested labelling.
- Always confirm critical interactions with a real screen reader (NVDA, JAWS, VoiceOver). This tool is a fast first check, not a replacement for testing with assistive technology.
- All parsing happens in your browser. Nothing you paste is uploaded.