Rule library Language

<html> element must have a lang attribute

html-has-langWCAG 2.0 A

Ensure every HTML document has a lang attribute

Who this affects

The page does not declare a language. Screen readers fall back to the user's system language and mispronounce the entire page.

How to fix it

Add lang to the <html> element, e.g. <html lang="nl">.

Effort Low · ~2 min

Before and after

Fails

<html>

Passes

<html lang="en-GB">

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-has-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