On each web page, is the default language present?
A screen reader like JAWS or NVDA chooses its synthesized voice based on the language declared in the page. Without a lang attribute on the <html> tag, it guesses. It may read French with English pronunciation, producing incomprehensible phonetic gibberish for blind users.
This criterion checks one thing only: is the default language of the page declared in the source code? In HTML5 and HTML4, it's the lang attribute on the <html> tag. In XHTML 1.0, both lang and xml:lang attributes must be present simultaneously. In XHTML 1.1, only xml:lang applies.
Warning: this criterion does not require that the language code be correct. That's criterion 8.4. Here, we only verify the presence of a declaration, whatever it is. Two distinct criteria, two distinct audits.
Un test to confirm that the default language of the page is indicated
Presence of lang attribute on <html>
- Open the page source code (Ctrl+U or your browser's Inspector).
- Locate the
<html>tag at the beginning of the document. - Verify according to the document type:
- HTML5 or HTML4: the
langattribute must be present on<html>(e.g.<html lang="en">). - XHTML 1.0: both
langandxml:langattributes must be on<html>. - XHTML 1.1: the
xml:langattribute must be present on<html>. - Other cases: verify that each text element or one of its ancestors carries a language indication.
- HTML5 or HTML4: the
- If a language indication is present, the test is validated. If no indication exists, the test fails.
Examples
❌ Non-compliant : HTML5 page without language declaration
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Home - My site</title>
</head>
<body>
<h1>Welcome to our site</h1>
<p>Find all our offers online.</p>
</body>
</html>The <html> tag does not have a lang attribute. The screen reader does not know in what language to read the content. It will use the default language from its user profile, often English, and pronounce French with incorrect phonetics. The text becomes incomprehensible when heard.
✅ Compliant : HTML5 page with language declaration on the html tag
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home - My site</title>
</head>
<body>
<h1>Welcome to our site</h1>
<p>Find all our offers online.</p>
</body>
</html>The lang="en" attribute on <html> tells the screen reader that the primary language is English. The speech synthesizer automatically selects an English-speaking voice and applies the appropriate phonetic rules. Criterion 8.3 is satisfied.
Tips and pitfalls
⚠️ lang present but empty: as problematic as absent
An <html lang=""> or <html lang=" "> does not satisfy the criterion. The value must exist and not be empty. This case is frequent in CMS systems that generate the attribute dynamically but omit to populate it from the multilingual configuration of the project.
💡 Criterion 8.3 ≠ criterion 8.4: presence vs. correctness
Criterion 8.3 checks only for the presence of a language declaration. Criterion 8.4 verifies that the code used is valid (ISO 639) and relevant (matches the language of the content). A page with <html lang="xx"> validates 8.3 but fails 8.4. In an audit, treat them separately.
⚠️ XHTML 1.0: two mandatory attributes, not just one
In XHTML 1.0, lang alone is not enough. You must also have xml:lang with the same value, as follows: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">. Missing either one causes test 8.3.1 to fail. In practice, this case is rare: almost all sites created since 2010 use the HTML5 doctype.
💡 Identify the doctype in two seconds
To know which rule to apply, look at the first line of the source code. <!DOCTYPE html> = HTML5 (lang on <html>). A W3C URI containing xhtml1-transitional or xhtml1-strict = XHTML 1.0 (lang and xml:lang). A URI containing xhtml11 = XHTML 1.1 (xml:lang only).
Frequently asked questions
What is the difference between RGAA criteria 8.3 and 8.4?
Criterion 8.3 checks only that the lang attribute is present on <html>. Criterion 8.4 checks that the value of this attribute is a valid ISO 639 code and corresponds to the primary language of the document. Both are complementary: 8.3 = presence, 8.4 = correctness. A missing lang fails 8.3. A lang="xx" invalid passes 8.3 but fails 8.4.
How do you test RGAA criterion 8.3 on the lang attribute during an audit?
Open the source code (Ctrl+U on most browsers) and search for the first occurrence of <html>. Check if the lang attribute is present and not empty. You can also use your browser's Inspector or the W3C Validator, which flags the absence of lang among its warnings.
Why must the lang attribute be placed on <html> and not on <body>?
No, not directly. The primary method is to declare lang on <html>. The RGAA methodology provides a fallback: if the attribute is not on <html>, each text element or one of its parents must carry the language indication. In practice, this is a very cumbersome solution to maintain. Always place lang on <html>.
How do you declare the default language of a multilingual site according to RGAA?
Declare on <html> the primary language of the page displayed, not the language of the interface or browser. An English content page must have <html lang="en">, even if the rest of the site is French. Each page manages its own lang independently of the others.
How do you configure the lang attribute with Next.js or React to comply with RGAA?
Not by default. In Next.js, configuring i18n.defaultLocale in next.config.js automatically injects the correct lang on <html>. In vanilla React, you must define it manually in your index.html file or in the root component. Always verify the final render in the browser: some SSR can overwrite the attribute on mount.