Language · WCAG 2.0 Level A
<html> element must have a valid value for the lang attribute
Ensure the lang attribute of the <html> element has a valid value.
What it means
The html-lang-valid rule flags elements that fail this check. It maps to WCAG success criterion 3.1.1.
Who it affects
Screen reader users, whose software needs the language to pronounce text correctly, plus translation tools.
How to fix it
Use a valid BCP 47 code in the html lang attribute, such as en, en-US, es or fr-CA.
<html lang="en-US">
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: html-lang-valid.
Quick answers
What does the axe rule "html-lang-valid" check?
Ensure the lang attribute of the <html> element has a valid value.
How do I fix "<html> element must have a valid value for the lang attribute"?
Use a valid BCP 47 code in the html lang attribute, such as en, en-US, es or fr-CA.
Who is affected by html-lang-valid 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.