Why do I need to set the page language for screen readers?

Published 11 November 2026 · Last updated · General information, not legal advice

You need to set the page language because screen readers use it to choose the right pronunciation rules. A screen reader set up for English that reads a German product page without a language declaration may read German words with English pronunciation, and the result can be hard to follow. WCAG 3.1.1 Language of Page (level A) asks that the default human language of each web page can be programmatically determined; W3C's first stated benefit is that "Screen readers can load the correct pronunciation rules."1 The fix is usually one attribute: lang on the html element, such as <html lang="en-GB">.1

Who else benefits

W3C lists other benefits of a correct page language: visual browsers can display characters and scripts correctly, and media players can show captions correctly.1 It names the people who benefit as screen reader and text-to-speech users, people who find it hard to read written material fluently, people with some cognitive, language and learning disabilities who use text-to-speech software, and people who rely on captions.1

How often is it missing?

It is one of the six most common failures WebAIM tracks. Its 2026 scan of the top million home pages found a missing document language on 13.5% of them, down from 15.8% in 2025.4 It is also one of the easiest to fix, usually in one template.

What the two criteria ask

CriterionLevelRequiresHow
3.1.1 Language of PageAThe page's main language can be determined by softwarelang on the html element (technique H57)
3.1.2 Language of PartsAAThe language of each passage or phrase in another language can be determinedlang on an element around that passage (technique H58)

Sources: Understanding 3.1.11 and 3.1.2.2 When a page uses several languages, the default is the one used most; if they are used equally, choose the first one used.1

Choosing the language code

W3C's internationalisation guidance says: "Always use a language attribute on the html tag to declare the default language of the text in the page."3 Its main points:

  • Use the html element, not body, because body does not cover the head, where the page title lives.3
  • Use standard tags from the IANA Language Subtag Registry, following BCP 47: en, en-GB, fr, zh-Hans.3
  • Do not use a meta element with http-equiv="Content-Language" to declare the language.3

Get the code right as well as present. A page in Spanish marked lang="en" because the theme was copied from an English store is arguably worse than no attribute, because it tells the screen reader the wrong thing with confidence.

Passages in another language

WCAG 3.1.2 asks you to mark passages or phrases that are in a different language from the page.2 Wrap them in an element with its own lang, such as <span lang="fr">.3 In a store, typical cases are:

  • A language switcher. W3C's example marks each language link with its own lang and writes it in that language, such as "Deutsch" and "Français".2 Without that, an English screen reader reads "Français" with English sounds.
  • Quoted reviews left in another language.
  • Product descriptions or care labels supplied in another language and not translated.
  • A tagline or motto in another language in the header.

You do not need to mark everything. The criterion excludes proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the surrounding language.2 W3C's example is "podcast" in French text, which needs no marking.2

Multilingual stores

If you sell in several languages, each version of a page should declare its own language. When a visitor switches to German, the html element should change to lang="de" along with the text. This also matters beyond accessibility: Google recommends that title elements use the same language and writing system as the page's main content, and says it may choose different text for a title link when they do not match.8

Shopify and WordPress

Shopify

Shopify's Theme Store requires that "The <html> element must specify a lang attribute."5 Themes from the Theme Store should therefore declare a language. The risk is in customised or older themes, and in stores that have added languages. View the source of a page in each of your languages and check the lang value matches.

WordPress and WooCommerce

Classic WordPress themes usually print the language with <html <?php language_attributes(); ?>> in header.php, a function that builds the language and text direction attributes for the page.6 It outputs lang using the site's language information, and only when that value is not empty.7 If a theme hard-codes lang="en" instead, or leaves the function out, the attribute will be wrong or missing on translated sites. If you use a multilingual plugin, check the output for each language.

How to check

  1. Run an automated check. Automated tools can detect a missing lang attribute; the WebAIM figures above come from an automated scan. Jralo's free check tests your homepage and up to five linked pages against WCAG 2.2 A and AA, and helps you understand which countries' accessibility laws may be relevant, with a link to a guide for each (general information, not legal advice).
  2. Check the value. A tool can see that lang="en" is present and valid, but not whether the page is really in English. View the source of each language version.
  3. Listen. With a screen reader, read a page and the language switcher. Does the pronunciation match the language?

Automated tools find many problems, not all; this is one where a tool does most of the work and a quick human look does the rest. For a wider first pass, see how to check your website in 15 minutes.

What else do people ask?

Should I use "en" or "en-GB"?

Either is a valid language tag. W3C's internationalisation guidance says to use tags from the IANA Language Subtag Registry, following BCP 47, such as en, en-GB, fr or zh-Hans. Use a region only when it matters, for example to match the spelling you use.

Do I need to mark every foreign word?

No. WCAG 3.1.2 excludes proper names, technical terms, words of indeterminate language and words that have become part of the surrounding language. A French brand name or "croissant" in English text does not need marking. A full sentence or quotation in another language does.

Do PDFs need a language too?

Yes. W3C lists setting the default language in the PDF document catalogue (technique PDF16) and marking the language of a passage (PDF19) as sufficient techniques for 3.1.1 and 3.1.2. Check the language in the document properties before you publish, as well as on your web pages.

Check your site now

Jralo's free check tests your homepage and up to five pages for accessibility (WCAG 2.2 A and AA) and website QA problems, and tells you which countries' accessibility laws are likely relevant to you. No sign-up.

Run the free check

Where do these facts come from?

Every number and legal statement in this post links to one of these sources, read on 13 October 2026.

  1. W3C WAI: Understanding Success Criterion 3.1.1 Language of Page
  2. W3C WAI: Understanding Success Criterion 3.1.2 Language of Parts
  3. W3C Internationalization: Declaring language in HTML
  4. WebAIM: The WebAIM Million, 2026 report
  5. Shopify: Theme Store requirements
  6. WordPress developer reference: language_attributes()
  7. WordPress developer reference: get_language_attributes()
  8. Google Search Central: Influencing your title links in search results

More questions

What should you read next?