Skip to main content
Perceivly: Perceivly home

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

Examples

Fails:No lang attribute on the html element
<!DOCTYPE html>
<html>
  <head>
    <title>Contact us | Acme</title>
  </head>
Fails:An invalid language code
<!DOCTYPE html>
<html lang="english">
  <head>
    <title>Contact us | Acme</title>
  </head>
Passes:A valid language tag on the html element
<!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

Common mistakes

Official W3C explanation of 3.1.1

Check your own page

See which automated WCAG checks your page fails, with the failing elements and how to fix them.

Enter a page address, for example example.com/shop.

Reviewed November 2, 2026