Rule library Language

<html> element must have a valid value for the lang attribute

html-lang-validWCAG 2.0 A

Ensure the lang attribute of the <html> element has a valid value

Who this affects

The declared language code is not valid, so assistive technology cannot select the right voice.

How to fix it

Use a valid BCP 47 code such as nl, de, fr or en-GB.

Effort Low · ~2 min

Where this sits in the standard

WCAG success criterionLevelEN 301 549 clause
3.1.1 Language of PageA301-549, 9.3.1.1

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: html-lang-valid

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