lang and xml:lang values must match

Accessibility isn’t only about avoiding violations — it’s about ensuring your product can be used confidently by everyone. This guide explains the principle of this rule, shows what goes wrong in real-world code, and provides a verified fix that meets WCAG and the European Accessibility Act (EAA).

Why this matters and how to fix it

Why this matters

Correct language declarations ensure proper pronunciation and processing by assistive technologies.

How to fix this issue

Set `lang` (and `xml:lang` where present) to the correct primary language of the page and keep them in sync.

Automated detection · Manual review recommended

Developer guidance

Drive language from a single locale source. Validate with the W3C Internationalization Checker in CI.


Code examples

Incorrect Implementation

<html lang="en" xml:lang="fr">…</html>

Correct Implementation

<html lang="en" xml:lang="en">…</html>
eu icon getwcag

Trusted by organizations across Europe working toward WCAG and EAA conformance