Understandable · Readable

WCAG 3.1.1 Language of Page Explained in Plain English

WCAG 3.1.1 Language of Page explained simply: why every page needs a lang attribute, which language code to use and how to check it in seconds.

3.1.1 Level A Added in WCAG 2.0 3 automated rules

Illustration: a globe icon, with 3.1.1 and Language of Page
Table of contents

3.1.1 Language of Page is the WCAG success criterion that says every page must declare its main language in the code. One attribute does it: lang on the html element, such as lang="en" or lang="fr". It tells screen readers which voice and pronunciation rules to use, and tells browsers and translation tools what language they are looking at. This guide explains WCAG 3.1.1 Language of Page in plain English, which code to use and how to check it.

The official wording: “The default human language of each Web page can be programmatically determined.” (W3C, WCAG 2.2)

What Is 3.1.1 Language of Page?

3.1.1 Language of Page is a Level A requirement under the Understandable principle, in the guideline “Readable”. “Default human language” means the main language the page is written in, not the programming language. “Programmatically determined” means it is in the code, where software can read it.

Two versions of a French page that says Bonjour, bienvenue sur notre site. With no lang attribute, the screen reader uses its default English voice and reads it as Bon-jowr, bee-en-vee-noo, which is hard to understand. With lang fr on the html element, it switches to a French voice and pronounces it correctly.
Without a language, screen readers guess, and usually guess their default language.

Why 3.1.1 Language of Page Matters

Screen readers have different voices and pronunciation rules for each language. If a page does not say which language it is in, the screen reader uses its default. A Spanish page read by an English voice is close to unintelligible.

The language also affects:

  • Braille displays, which use language-specific contraction rules
  • Browser translation, which offers to translate when the page language differs from the user’s
  • Hyphenation and spell checking, which depend on the language
  • Captions and dictionaries in some browsers and reading tools

Who Is Affected by 3.1.1 Language of Page

  • People who are blind and use screen readers or braille displays
  • People with dyslexia or low vision who use text-to-speech
  • People who rely on automatic translation to read a site in their own language
  • People with cognitive disabilities who use reading tools that look up words

How to Meet 3.1.1 Language of Page

Add a lang attribute to the html element

This is the W3C technique H57, using the language attribute on the HTML element:

<!doctype html>
<html lang="en">
Common language codes: en English, en-US English (US), en-GB English (UK), es Spanish, fr French, de German, pt-BR Portuguese (Brazil) and zh-Hans Chinese (Simplified). The attribute goes once, on the html element, for example html lang en-US.
Use a valid language code, optionally with a region or script.

Use a valid code

Codes follow the BCP 47 standard: a two- or three-letter language code, optionally followed by a region (en-GB) or script (zh-Hant). Common mistakes include country codes used as languages (lang="uk" is Ukrainian, not English), made-up values such as lang="english", and placeholders such as lang="xx". The W3C’s guide to choosing a language tag explains the format.

Set the right language on every version of your site

On multilingual sites, each language version must set its own lang. The French pages need lang="fr", not the English default copied from a template. In WordPress, Shopify and most site builders, the language comes from the site or store language setting, so check that it is set correctly for each locale.

Mark passages in other languages

If a page includes a quote, product name or paragraph in another language, mark it with its own lang attribute. That is a separate criterion, 3.1.2 Language of Parts.

How to Test for 3.1.1 Language of Page

  1. View the page source and look at the first lines. The html element should have a lang attribute.
  2. Check the value is a valid code that matches the main language of the content.
  3. Check every template and language version, including pages generated by apps, checkouts and help centers on subdomains.
  4. Listen with a screen reader on a translated page. The voice should match the language.

Automated scans catch missing and invalid values reliably, so this is one of the fastest WCAG fixes you can make.

Run a free WCAG scan to check the language attribute on any page in seconds.

Testing WCAG 3.1.1 With AccessBell

AccessBell's scanner runs axe-core, which includes 3 rules that catch code-level failures of this criterion. Automated checks help you spot issues quickly; a person still needs to review what they cannot judge.

This criterion is included in: WCAG 2.2 AA Checker, WCAG 2.1 AA Checker, ADA Compliance Checker, Section 508 Checker, EN 301 549 Checker.

Run a free scan to spot issues on your own pages.

Example Fix

  1. Declare the page language. Add a lang attribute to the html element so screen readers use the right pronunciation.
  2. Mark language changes. Wrap phrases in another language with their own lang attribute.
<!doctype html>
<html lang="en">
  <head>...</head>
  <body>
    <p>Our motto is <span lang="fr">savoir-faire</span>.</p>
  </body>
</html>

Frequently Asked Questions

What level is WCAG 3.1.1 Language of Page?

Level A. It has been in WCAG since version 2.0.

Do I need en-US or is en enough?

Either passes 3.1.1 Language of Page. The primary code, such as en, is what matters. A region subtag, such as en-US or en-GB, adds detail some tools use for spelling and pronunciation.

What if my page uses more than one language?

Set the lang attribute on the html element to the main language of the page, then mark passages in other languages with their own lang attribute. That second part is 3.1.2 Language of Parts, a Level AA criterion.

Can automated tools test 3.1.1 Language of Page?

Mostly, yes. Tools reliably find a missing or invalid lang attribute. They cannot always tell whether the declared language matches the actual content, so check translated pages by eye.

Can AccessBell test WCAG 3.1.1 automatically?

Yes. AccessBell runs 3 automated rules that can catch failures of this criterion, including in our WCAG 2.2 AA Checker, WCAG 2.1 AA Checker, ADA Compliance Checker, Section 508 Checker, EN 301 549 Checker. A person still needs to check what automation cannot judge.

Sources

This page explains a technical standard and is not legal advice. See our disclaimer.

About the Author

Anton StewartAuthor

Contributor, AccessBell

Anton Stewart writes and reviews accessibility guides for the AccessBell blog, checked against the W3C standards and other primary sources.

How we reviewed this page
  1. Current version

    First published. Checked against the W3C WCAG 2.2 Recommendation, the Understanding document for 3.1.1 Language of Page and W3C technique H57.

Check Your Site Against WCAG 3.1.1

Run a free scan to spot 3.1.1 Language of Page issues and every other automated WCAG check, then get help fixing them.

Pro is a 3-day free trial, then $29 per domain per month or $199 per year. You add a card at checkout and are not charged until the trial ends. Cancel before then and you will not be charged.

Not ready for a subscription? A Page Report is $19 for one page, and a Domain Audit is $79 for up to 500 pages.