Use valid language codes in the lang attribute

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

Invalid language codes prevent assistive technologies from determining pronunciation rules. For example, `lang='english'` is invalid — it must be `lang='en'`.

How to fix this issue

Use only ISO language codes as defined by BCP 47 (e.g., 'en', 'sv-SE', 'de', 'fr-CA').

Automated detection · Manual review recommended

Developer guidance

Check your code with validators or use automated linting tools to enforce valid language tags.


Code examples

Incorrect Implementation

<html lang='english'></html>

Correct Implementation

<html lang='en'></html>
eu icon getwcag

Trusted by organizations across Europe working toward WCAG and EAA conformance