How to fix: Page missing language attribute
The <html> tag needs a lang attribute that names the page's primary language, for example <html lang="en">, so assistive technology pronounces the content correctly.
What it is
The lang attribute on the root <html> element declares the human language of the page. WCAG Success Criterion 3.1.1 Language of Page requires this so software, especially screen readers, can determine how to read the content. The value is a standard language tag like en (English), es (Spanish), fr (French), or a regional variant like en-US or pt-BR.
When the attribute is present, a screen reader loads the matching pronunciation rules and voice. When it is missing, the screen reader falls back to the user's default voice, which may be wrong for your content. The result is text read with the phonetics of the wrong language: English announced with Spanish vowels, or French read as though it were English, often to the point of being unintelligible.
This is one of the simplest fixes in all of WCAG. It is a single attribute on a single element. If parts of the page are in a different language than the page default, you can additionally set lang on those specific elements, but the root declaration is the requirement this rule checks.
Who it affects & why it matters
Screen reader users are the primary group. The pronunciation engine relies on the declared language to choose phonemes, intonation, and even how it reads numbers and abbreviations. With no language set, content can be garbled enough that a user cannot follow it, even though every word is technically being spoken.
It also affects braille display users (translation tables are language-specific), some people with reading or cognitive disabilities who use text-to-speech, and downstream tooling like translation services and search engines, all of which use the declared language to process the page correctly.
A missing language attribute is a Level A failure under SC 3.1.1, and missing document language is repeatedly listed among the most common WCAG failures in the WebAIM Million report. It is also one of the six issue types most frequently cited in ADA web accessibility complaints, partly because it is so easy for an automated tool to detect.
Given that the fix is literally one attribute and resolves the entire page-level violation, leaving it off is hard to justify. WCAG 2.1 Level AA is the de-facto ADA benchmark courts apply, and clearing a documented, trivially-detectable Level A failure removes an obvious item from any audit or demand letter.
How to fix it
- Open the page's root <html> element (in your template, layout, or framework's document head).
- Add a lang attribute with the correct language code, for example lang="en" or lang="en-US".
- If your site serves multiple languages, set the value dynamically so each localized page declares its own language.
- For any inline passages in a different language, add lang on those specific elements as well.
- Re-scan to confirm the <html> element now carries a lang attribute.
<!DOCTYPE html>
<html>
<head>...</head>
<body>...</body>
</html><!DOCTYPE html>
<html lang="en">
<head>...</head>
<body>...</body>
</html>How AccessKnight detects this
AccessKnight locates the root <html> element in the parsed document and checks whether it has a lang attribute. If the attribute is absent, the page is flagged once with the fix to add lang to the <html> tag (for example <html lang="en">). This is a single page-level check rather than a per-element scan, so resolving it clears the issue for the whole document.