Skip to the checklist
The Focus RingWCAG · screen readers · assistive tech

Checklist › Cognitive

Language and Purpose: Tagging Content So Assistive Tech Reads It Right

Filed 2026-10-25

1 Why this criterion exists

Language is the foundation of understanding. When a web page declares its primary language, assistive technologies can present content correctly. Screen readers, for example, use the language tag to select the appropriate speech synthesizer, pronunciation rules, and braille translation tables. Without this information, a screen reader might read English text with a Spanish accent, or worse, produce unintelligible output. This criterion, Language of Page, is a Level A requirement under the Web Content Accessibility Guidelines (WCAG). It sits under the Understandable principle, which ensures that information and operation of the user interface are understandable. The success criterion specifically requires that the default human language of each web page can be programmatically determined. In practice, this means adding a lang attribute to the html element. This simple step has a profound impact on users who rely on auditory or tactile output. It also benefits users who employ translation tools or who have cognitive disabilities that affect language processing. By declaring the language, authors enable assistive tech to adapt content to the user's needs, making the web more inclusive and functional for everyone.

2 Who it protects

This criterion primarily protects people who are blind or have low vision and use screen readers or braille displays. For these users, the language tag is not a minor detail; it determines how text is pronounced or rendered in braille. If the language is misidentified, the output can be confusing or completely wrong. For instance, a screen reader set to Spanish might read English words with Spanish phonetics, making them unrecognizable. Braille users may encounter incorrect contractions or character mappings. Additionally, individuals with cognitive disabilities such as dyslexia or language processing disorders benefit from accurate language tagging because it allows text-to-speech tools to read content in a consistent and expected manner. People who use translation software also rely on language tags to automatically detect and translate content correctly. Without proper tagging, these users face barriers that can prevent them from accessing information altogether. The criterion also supports users who are deaf or hard of hearing by ensuring that captions and transcripts are correctly associated with the language of the media, though that is more directly covered by other criteria. Overall, Language of Page is a foundational accessibility feature that enables many other technologies to work effectively.

3 How conformance is measured

Conformance to Success Criterion 3.1.1 is measured by checking whether the default human language of the page can be programmatically determined. In practice, this means verifying that the html element has a lang attribute with a valid language tag. Automated tools like axe, WAVE, or Lighthouse can quickly flag pages that are missing the lang attribute or that use an invalid value. However, automated checks only tell part of the story. A human evaluator should also confirm that the language tag accurately reflects the primary language of the content. For example, a page written in French should have lang="fr", not lang="en". If the page contains passages in a different language, those passages should have their own lang attributes, but that is covered by a separate criterion (3.1.2 Language of Parts). For this criterion, the focus is on the page as a whole. Manual testing involves inspecting the HTML source or using browser developer tools to view the lang attribute. Additionally, testing with a screen reader can provide direct feedback: the screen reader should announce the page language or switch to the correct voice profile. If the screen reader reads content with the wrong pronunciation, it may indicate a missing or incorrect lang attribute. Thus, conformance is both a technical check and a user experience validation.

4 Where teams usually slip

One common mistake is omitting the lang attribute altogether. Developers sometimes assume that browsers or assistive tech will automatically detect the language, but this is not reliable. Another frequent error is using an invalid or incorrect language tag. For instance, using lang="en-US" is valid, but lang="english" is not. Some teams set the lang attribute on the body element instead of the html element, which can still work but is less standard and may not be recognized by all assistive technologies. A more subtle slip is when a page's primary language changes but the lang attribute is not updated, such as in a content management system that serves multiple languages. Additionally, single-page applications that dynamically load content in different languages may forget to update the lang attribute when the language changes. Teams also sometimes confuse the language of the page with the language of the user interface; if the interface is in English but the content is in Spanish, the lang attribute should reflect the content's language. Finally, some developers use the lang attribute for styling purposes or for specifying the language of a script, which is incorrect. These slips can lead to a poor experience for screen reader users and others who depend on accurate language metadata.

5 Fixing it in your markup

The fix for Success Criterion 3.1.1 is straightforward: add a lang attribute to the html element of every page. The value should be a valid BCP 47 language tag, such as "en" for English, "es" for Spanish, or "fr-CA" for Canadian French. If the page is primarily in one language, that single attribute is sufficient. For pages that serve content in multiple languages, you may need to set the lang attribute dynamically based on the user's language preference or the content being displayed. In cases where the page includes short phrases or passages in another language, you should also add lang attributes to those inline elements, but that is covered by Success Criterion 3.1.2. When implementing, ensure that the lang attribute is present in the initial HTML response, not added later via JavaScript, because assistive technologies may begin processing the page before scripts run. If you are using a framework or content management system, check whether it automatically sets the lang attribute; many do, but some require configuration. For example, in HTML, you would write <html lang="en">. In React, you might set it on the <html> element in your index.html file. Always validate the language tag using a tool or reference to avoid typos. This simple addition significantly improves accessibility for users of screen readers and other assistive technologies.

6 Testing before you ship

Before releasing a page, you should test for the presence and correctness of the lang attribute. Start with automated tools: run an accessibility checker like axe, WAVE, or Lighthouse. These will flag missing or invalid lang attributes. However, automated tools cannot verify that the language tag matches the actual content language, so manual checks are necessary. Inspect the page source or use developer tools to confirm that the html element has a lang attribute with a valid value. If your site supports multiple languages, test each language version to ensure the correct tag is applied. Next, perform screen reader testing. Use a screen reader to navigate to the page and listen to how it announces the language. For example, in NVDA or JAWS, you can check the language by pressing a keyboard shortcut to read the document language, or simply listen to the pronunciation. If the screen reader reads the content with the wrong accent or voice, the lang attribute may be incorrect. Also, test with a braille display if possible, as braille translation tables depend on the language tag. Finally, consider users who might switch languages mid-session; ensure that the lang attribute updates appropriately if your application allows language changes without a full page reload. Document your testing process and include it in your accessibility conformance reports. Regular testing helps catch regressions and ensures ongoing compliance.

7 Frequently asked questions

What is the difference between Language of Page and Language of Parts? Language of Page (3.1.1) requires that the default language of the entire page is programmatically determinable, typically via the lang attribute on the html element. Language of Parts (3.1.2) requires that any passage or phrase in a different language is also marked with a lang attribute. Both are Level A criteria under the Understandable principle. Do I need to set the lang attribute if my page is only in English? Yes, even if your page is in English, you should set lang="en". Assistive technologies may default to the user's system language, which might not be English, leading to incorrect pronunciation. Setting the lang attribute ensures consistent behavior. What if my page contains multiple languages? The lang attribute on the html element should reflect the primary language of the page. For sections in other languages, use lang attributes on those elements. If the page has no clear primary language, you might need to choose the most predominant one or use a more complex solution, but that is rare. Can I use lang="en-US"? Yes, that is a valid BCP 47 tag. However, using just "en" is usually sufficient and more inclusive. Will screen readers automatically detect the language if I don't set it? No, screen readers rely on the lang attribute to determine the language. Without it, they may use the user's default language, which can lead to mispronunciation. Is the lang attribute required for WCAG conformance? Yes, for Level A conformance, Success Criterion 3.1.1 must be met, which requires the lang attribute. How do I test the lang attribute? Use automated tools and manual inspection, and test with a screen reader to verify correct pronunciation.