Start a project

Tool 33 of 194 · Accessibility

ARIA Role & Attribute Validator

Paste HTML with ARIA and get every role and attribute checked against the spec, with the line, the rule and what to change.

ARIA Role & Attribute Validator at a glanceIllustration: 1, ARIA markup; 2, processed in your browser; 3, Validated.ARIA Role & Attribute Validator</>1ARIA markup3Validated2In yourbrowser
1 ARIA markup 2 processed on your device 3 Validated

ARIA Role & Attribute Validator

Your HTML

Problems and fixes

RuleLineElementProblemFix

Your source, marked

    Problems by rule

    Structure your roles need

    RoleMust be insideMust containRequires

    01

    What it does

    Checks the ARIA in pasted HTML against the ARIA 1.2 role model and ARIA in HTML, and gives each problem a rule, a line and a fix.

    • Invalid, abstract and misspelt roles, and role fallback lists
    • Unknown, deprecated, unsupported and prohibited attributes
    • Required attributes, with native HTML equivalents allowed
    • Value types: true/false, tokens, numbers, and ID references that must exist

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Problems with rule ids, lines and fixes, a marked-up source and the structure each role needs, with a Copy and a Download button on every result.

    • Accessibility
    • ARIA
    • Validation
    • HTML

    Why it matters

    The first rule of ARIA is not to use it when HTML will do, because wrong ARIA is worse than none: a role="menu" on a site navigation makes screen readers switch into application mode and expect arrow keys, an aria-labeledby typo silently does nothing, and a role="tab" outside a tablist breaks the widget. Linters catch some of this in JSX; browsers say nothing at all.

    This validator checks pasted HTML against the WAI-ARIA 1.2 role model and the ARIA in HTML rules. For every element it resolves the role (taking the first valid token in a fallback list), checks each aria- attribute exists, is allowed on that role and has a valid value, that ID references point at real elements, that required attributes are present unless HTML already provides them, that widgets contain the children they must and sit inside the parent they must, that the role is allowed on that element, and that nothing focusable is hidden with aria-hidden. Each finding has a rule id, the line it's on and a concrete fix, and the source is shown with problem lines marked.

    How it works

    1. InputHTML with roles and aria- attributes
    2. In your browserChecked against ARIA 1.2 and ARIA in HTML
    3. OutputProblems by line with fixes

    Where it fits in a designer's workflow

    1. Plan
    2. Design
    3. Build
    4. Test
    5. Launch
    Building custom widgets such as tabs, menus and listboxes.

    By the numbers

    ARIA problems in the sample markup, by rulerequired-children: 3 problems; required-parent: 3 problems; attr-required: 2 problems; attr-value: 2 problems; idref-missing: 2 problems; role-redundant: 2 problems; widget-focus: 2 problems; aria-in-html: 1 problem; attr-invalid: 1 problem; attr-unsupported: 1 problemrequired-children3 problemsrequired-parent3 problemsattr-required2 problemsattr-value2 problemsidref-missing2 problemsrole-redundant2 problemswidget-focus2 problemsaria-in-html1 problemattr-invalid1 problemattr-unsupported1 problem
    Counted by this tool from its sample: 24 problems (18 errors) in 25 elements. Structure rules lead: a menu built from list items and a tab panel placed inside its tablist each break more than one relationship at once. Source: W3C: WAI-ARIA 1.2; W3C: ARIA in HTML.
    Show the numbers as a table
    RuleProblems
    required-children3
    required-parent3
    attr-required2
    attr-value2
    idref-missing2
    role-redundant2
    widget-focus2
    aria-in-html1
    attr-invalid1
    attr-unsupported1
    hidden-focus1
    name-prohibited1
    name-required1
    role-abstract1
    role-invalid1

    How to use it

    1. Paste the HTML.
    2. Work through the errors first, then the warnings.
    3. Use the marked source to find each line.
    4. Check the structure table for the widgets you're building.

    FAQ

    Is ARIA ever required?

    Only when HTML has no element for what you're building, like tabs, a tree or a combobox with custom behaviour. For buttons, links, checkboxes and landmarks, the native elements are better and need no ARIA.

    What's a required owned element?

    Some roles only work with specific children: a tablist must contain tabs, a list must contain listitems, a listbox must contain options. Screen readers count and navigate those children, so missing or extra ones break the widget.

    Why is role="button" on a <button> flagged?

    It's redundant: the element already has that role. It does no harm, but it's noise, and the habit leads to conflicting roles.

    Why do some attributes say 'not supported'?

    Each role supports a fixed set of states. aria-checked on a button, for example, is ignored; a toggle button uses aria-pressed instead.

    Does it check keyboard behaviour?

    Only that widget roles on non-focusable elements are flagged. Whether arrow keys and Enter work needs a running page; the ARIA Authoring Practices Guide lists the keys each widget needs.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk