All WCAG rules
WCAG 3.1.1Level ASeriousDocument

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

  1. Open the page's root <html> element (in your template, layout, or framework's document head).
  2. Add a lang attribute with the correct language code, for example lang="en" or lang="en-US".
  3. If your site serves multiple languages, set the value dynamically so each localized page declares its own language.
  4. For any inline passages in a different language, add lang on those specific elements as well.
  5. Re-scan to confirm the <html> element now carries a lang attribute.
Before
<!DOCTYPE html>
<html>
  <head>...</head>
  <body>...</body>
</html>
After
<!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.

Frequently asked questions

Where exactly does the lang attribute go?

On the root <html> element: <html lang="en">. It does not belong on <body> or <head> for this requirement. If specific sections are in another language, you can add lang to those individual elements in addition to the root declaration.

Is a missing lang attribute Level A or AA?

It fails WCAG 2.1 Success Criterion 3.1.1 Language of Page, which is Level A. AccessKnight treats it as serious severity because incorrect pronunciation can make an otherwise-readable page unusable for screen reader users.

What value should I use for English?

Use lang="en" for English in general, or a region-specific tag like lang="en-US" or lang="en-GB" if you want to signal the locale. Use the standard BCP 47 language tag that matches your content's primary language.

My site is multilingual. Do I set one value?

Set the lang value to match the language actually being served on each page, so a Spanish page declares lang="es" and an English page declares lang="en". For mixed-language passages within a page, also set lang on the specific elements that differ from the page default.

Is this issue on your site?

AccessKnight scans any page against all 30 WCAG 2.1 rules — including this one — and shows every instance with a fix. Free, no credit card.

Scan my site free →

More WCAG fixes