Page and Passage Language
Declare valid page and passage language tags so screen readers, braille translation, and language-aware tools use the correct rules
WCAG 3.1.1 requires the default human language of each page to be programmatically determined. WCAG 3.1.2 requires language changes within content to be identified, except for proper names, technical terms, words of indeterminate language, and words that have become part of the surrounding language.
Use valid BCP 47 tags such as en, en-ZA, fr, or ar. Put the page default on <html>, then use lang on the smallest element that contains a genuine language change. Also set dir when the writing direction changes.
Undeclared Language Change vs. Page and Passage Tags
Welcome
Complete your profile.
Bienvenue. Complétez votre profil.
View inaccessible code
<html><p>Welcome.</p><p>Bienvenue.</p></html>Welcome
Complete your profile.
Bienvenue. Complétez votre profil.
مرحبًا بك
View accessible code
<html lang="en">
<p>Welcome.</p>
<p lang="fr">Bienvenue.</p>
<p lang="ar" dir="rtl">مرحبًا بك</p>
</html>Test it
Inspect the browser accessibility tree and listen with language voices installed. Test text inserted dynamically and localized validation messages. Do not use audible pronunciation alone as proof because available voices and screen-reader language settings vary.