The HTML element must have a lang attribute

Log in (Premium content) Request a demo

Rule Description

The HTML document must contain a valid lang attribute or must correspond to a valid lang code for multilingual screen reader users who may prefer a language other than the default.

The Algorithm, in Simple Terms

Ensures that every HTML document has a lang attribute

Why this is Important

When configuring a screen reader, users select a default language. If the language of a webpage is not specified, the screen reader will assume it is the default language set by the user. This becomes an issue for users who speak multiple languages and access website in more than one language. It is important to specify a language and ensure that it is valid so website text is pronounced correctly.

How to Fix the Problem

Add a lang attribute to the html element (e.g. <html lang="en">) whose value represents the primary language of document.

Compliance Data & User Impact

User Impact: Serious
Disabilities Affected:
  • Blindness
  • Deafblindness
  • Cognitive
Issue Type:
  • WCAG 2.0 (A): MUST
  • WCAG 2.1 (A): MUST
WCAG Success Criteria:
  • 3.1.1 Language of Page
Section 508 Guidelines:
  • Not applicable

Related Deque University Course Pages

Other Related Resources

Additional Information

Relevant Technologies:
  • HTML 4
  • HTML5
Test Reliability: Automated testing is possible, with high accuracy
Rule ID: html-has-lang