Language · WCAG 2.0 Level AA
lang attribute must have a valid value
Ensure lang attributes have valid values.
What it means
The valid-lang rule flags elements that fail this check. It maps to WCAG success criterion 3.1.2.
Who it affects
Screen reader users, whose software needs the language to pronounce text correctly, plus translation tools.
How to fix it
Fix lang attributes on inner elements to use valid language codes.
<p lang="es">Bienvenidos</p>
Check it on your site
Run a free scan. If this rule fails, the results list the affected elements. Deque, which maintains axe-core, also documents this rule in detail: Deque University: valid-lang.
Quick answers
What does the axe rule "valid-lang" check?
Ensure lang attributes have valid values.
How do I fix "lang attribute must have a valid value"?
Fix lang attributes on inner elements to use valid language codes.
Who is affected by valid-lang failures?
Screen reader users, whose software needs the language to pronounce text correctly, plus translation tools.
Automated accessibility scan. Results are informational and may not identify every accessibility issue. This service is not legal advice, a compliance certification, or a substitute for comprehensive manual accessibility testing.