Rule library Language

lang attribute must have a valid value

valid-langWCAG 2.0 AA

Ensure lang attributes have valid values

Who this affects

A lang attribute on an element has an invalid value.

How to fix it

Use a valid BCP 47 language code.

Effort Low · ~5 min

Where this sits in the standard

WCAG success criterionLevelEN 301 549 clause
3.1.2 Language of PartsAA301-549, 9.3.1.2

EN 301 549 clause 9 applies these criteria to web content. The published version referenced by the European Accessibility Act is V3.2.1, which incorporates WCAG 2.1 level A and AA. More on the standard.

How to check it by hand

View source and check the lang attribute on <html>. Then look for passages in another language — a quotation, a product name, a testimonial — and confirm they carry their own lang attribute.

Automated testing settles roughly a third of the WCAG success criteria. This rule is one an automated tool detects reliably — but a clean automated result is not proof of conformance.

Reference

Deque's technical write-up for this rule: valid-lang

See whether your site trips this rule

Paste a URL. We open it in a real browser, dismiss the cookie wall and run the full EN 301 549 rule set. No account, no card.

Run a free scan All rules