Level A · WCAG 2.0
3.1.1 Language of Page
The page states in its markup which language it is written in.
Partly automated Some failures are detectable, others need judgement.
How it fails in practice
<html> with no lang, so a German page is read aloud by an English synthesiser and comes out as nonsense.
How to fix it
Set lang on the html element, per page, matching what the page is actually written in.
At a glance
- Level
- Level A — the minimum. Failing one of these usually makes something impossible rather than merely hard.
- Principle
- Understandable
- Guideline
- 3.1 Readable
- Added in
- WCAG 2.0
- EN 301 549
- 9.3.1.1
- Automated check
- Partly automated
Partly automated
How far an automated check gets
A tool finds some failures here and cannot see the rest. A clean automated result means the checks that exist found nothing — not that the criterion is met. This is the gap that makes a green scan look like an accessible site, and it is where the keyboard agent, the agents still in development and a human reviewer do the remaining work.
A missing or invalid lang is found on every page, and the declared language is compared with the language the main text is written in. A clean result is still not a pass: with little text, or two languages the detector confuses, a person decides. One of the cheapest real failures to fix.
Rules that check this criterion
html-has-langPage language missinghtml-lang-validInvalid page language
The rule ids are axe-core’s (version 4.14.0), the open-source engine our scan runs, and our keyboard agent’s — the names a report or a CI log will show. An underlined id has a page of its own here.
Where it matters most
The guides that list it among the criteria to check first.
Related criteria
Other criteria under the same guideline.
Further reading
-
Language attribute
The lang attribute declares the language of a page or passage so screen readers pronounce it correctly (WCAG 3.1.1, 3.1.2).
-
html-has-lang
The axe rule html-has-lang flags an html element with no lang attribute. Why screen readers mispronounce the page, and the one-line fix with code example.
-
html-lang-valid
The axe rule html-lang-valid flags a lang value on html that is no valid language tag, such as en_GB. How to write it correctly, with code example.
Find out which criteria your site fails
We scan up to 100 pages against WCAG 2.2 AA, send the keyboard agent through the page you name and email you the report — free, once, no strings.