Missing Language Attribute
What is this issue?
A missing language attribute occurs when the <html> element does not include a valid lang attribute specifying the primary language of the page content. WCAG Success Criterion 3.1.1 (Level A) requires that the default human language of each web page can be programmatically determined. Without this attribute, assistive technologies cannot determine which language to use for pronunciation, and browsers cannot apply language-specific rendering.
The lang attribute is a single addition -- lang="en" for English, lang="fr" for French, lang="es" for Spanish -- but its absence has far-reaching consequences. Screen readers use the language declaration to select the correct speech synthesis voice and pronunciation rules. Without it, a French screen reader may attempt to read English text using French phonetics, producing gibberish that is impossible to understand.
This issue is surprisingly common. Many HTML boilerplates and starter templates include lang="en" by default, but CMS-generated pages, email templates, and legacy sites often omit it entirely. Even when present, the lang attribute is sometimes set to the wrong language -- a site serving French content with lang="en" is just as problematic as having no lang attribute at all.
Impact on users
When a screen reader encounters a page without a lang attribute, it falls back to the user's default language setting. If a French-speaking user visits an English page that lacks lang="en", their screen reader reads the English text with French pronunciation, making it nearly incomprehensible. Multilingual users face this problem on every page without a language declaration.
Browser auto-translation features also rely on the lang attribute. Without it, Chrome's translation bar may not appear or may offer incorrect source language detection. Language-specific CSS features like hyphenation (hyphens: auto) and quotation marks (q element rendering) also depend on the lang attribute to function correctly.
Search engines use the lang attribute as a signal for serving content to users in the appropriate language. Missing language declarations can result in content being served to the wrong audience in international search results, reducing both traffic quality and user satisfaction.
Code example
<!-- No lang attribute -->
<html>
<head>
<title>About Us</title>
</head>
<body>
<h1>About Our Company</h1>
</body>
</html>
<!-- Wrong language -->
<html lang="en">
<body>
<h1>Bienvenue sur notre site</h1>
</body>
</html><!-- Correct lang attribute -->
<html lang="en">
<head>
<title>About Us</title>
</head>
<body>
<h1>About Our Company</h1>
</body>
</html>
<!-- Correct language with inline switch -->
<html lang="en">
<body>
<h1>About Us</h1>
<p lang="fr">Bienvenue sur notre site</p>
</body>
</html>How Scrutia detects this issue
Scrutia checks every page for the presence and validity of the lang attribute on the <html> element. It flags pages with no lang attribute, empty lang values, invalid language codes, and cases where the declared language does not match the detected content language. The report includes the correct lang code to add based on the page's actual content.
Check your site for this issue
Scrutia audits your site against WCAG criteria in minutes.
Frequently Asked Questions
What format should the lang attribute use?
How do I handle multilingual pages?
Does the lang attribute affect SEO?
Does your site have this issue?
Scrutia scans your pages against WCAG success criteria and delivers actionable fixes. Results in 5 minutes.
Run a free audit