Language · WCAG 2.0 Level A
HTML elements with lang and xml:lang must have the same base language
Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page.
What it means
The html-xml-lang-mismatch 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
Set a valid BCP 47 language code, such as lang="en", on the html element and on passages in other languages.
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-xml-lang-mismatch.
Quick answers
What does the axe rule "html-xml-lang-mismatch" check?
Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page.
How do I fix "HTML elements with lang and xml:lang must have the same base language"?
Set a valid BCP 47 language code, such as lang="en", on the html element and on passages in other languages.
Who is affected by html-xml-lang-mismatch 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.