3.1.1 Language of Page
Level A · added in WCAG 2.0
Each page must state its default human language in code. You do this with a valid lang attribute on the html element, such as lang="en" for English.
Who it helps
Screen readers use the lang attribute to pick the right voice and pronunciation rules. Without it, a Spanish page may be read with English pronunciation and become hard to understand. Browsers also use it for translation, hyphenation and font choice.
How to meet it
- Add a lang attribute to the html element on every page and template.
- Use a valid BCP 47 language tag, such as "en", "en-US", "es" or "fr-CA".
- Set the value to the main language of the page content, not the language of the site's owner or server.
- On multilingual sites, set lang per page so each translation declares its own language.
- Mark passages in other languages with their own lang attribute, which is covered by 3.1.2.
Examples
<!DOCTYPE html>
<html>
<head>
<title>Contact us | Acme</title>
</head><!DOCTYPE html>
<html lang="english">
<head>
<title>Contact us | Acme</title>
</head><!DOCTYPE html>
<html lang="en">
<head>
<title>Contact us | Acme</title>
</head>Can a scanner detect this?
Partly
Automated tools reliably catch a missing lang attribute, an invalid code, or lang and xml:lang values that disagree. They cannot tell whether the declared language matches the actual content, such as lang="en" on a German page.
axe-core rules that test it
html-has-langhtml-lang-validhtml-xml-lang-mismatch
Common mistakes
- Leaving lang="en" from a template on pages that are written in another language.
- Using a full language name or a country code alone, such as lang="english" or lang="us".
- Setting lang on the body or a wrapper div instead of the html element.
- Forgetting lang on pages rendered outside the main template, such as error pages and emails viewed in the browser.
Related criteria
Check your own page
See which automated WCAG checks your page fails, with the failing elements and how to fix them.
Reviewed November 2, 2026