Accessibility Wiki

The page must declare its language

Rule html-lang · Document, language & navigation · impact serious · Static + live

↩ Back to the rules index · WCAG cross-reference

Why it matters

Without <html lang>, screen readers guess the language and may read the page with the wrong pronunciation rules, making it hard to understand.

How to fix

Add lang to the <html> element with the language most of the page is written in, e.g. <html lang="en"> or <html lang="he">. Nothing else counts: xml:lang, a <meta http-equiv="content-language">, or lang on <body> are ignored by browsers and screen readers in an HTML document. In a CMS, set it once in the base template so every page inherits it, and let a page in another language carry its own value.

Example

✕ Fails
<html><body>Hi</body></html>
✓ Passes
<html lang="en"><body>Hi</body></html>

Example

✕ Fails
<html xml:lang="en"><body>Hi</body></html>
✓ Passes
<html lang="en" xml:lang="en"><body>Hi</body></html>

WCAG success criteria

3.1.1 Language of Page — Level A

The default human language of the page must be set programmatically (<html lang>).

Understanding 3.1.1

Standards

This rule contributes to the following standards:

WCAG A EN 301 549 Trusted Tester ACT

Standard Criteria
EN 301 549 9.3.1.1
Trusted Tester v5 11.a
ACT (WCAG SC) 3.1.1

References

Generated from the EqualWeb accessibility engine’s rule metadata. Back to top ↑