One attribute, read by screen readers before anything else
One attribute on one element decides which voice reads your page aloud, whether a browser offers to translate it, and how a hyphenation engine breaks your words. It is a line in a layout template, and a wrong value is worse than none.
The short answer
The html lang attribute tells screen readers which pronunciation rules to use and browsers whether to offer translation. It takes a language tag, not a country: en, en-GB, pt-BR. Getting it wrong makes a screen reader read English with German phonetics, which is not a subtle degradation, it is unintelligible.
One attribute, and the voice that reads your page
<html lang="de"> is read by more things than any other attribute of comparable size.
- A screen reader picks its pronunciation from it. This is the primary consumer and the reason the check exists. German text read by an English voice is not accented, it is unintelligible, and the visitor has no way to correct it.
- A browser decides whether to offer translation. No declaration means guessing from the text, which usually works and sometimes offers to translate a page into the language it is already in.
- Typography depends on it. Hyphenation, quotation mark style and the shape of certain characters are language-specific. Two languages sharing an alphabet do not share their line-breaking rules.
- Spell checking in form fields follows it. A visitor typing German into a field on a page declaring English gets every word underlined.
- Search engines use it as one signal among several. The weakest item on this list. Google has said it works out language from the content, so this attribute is corroboration rather than instruction.
The ordering matters when you are deciding whether this is worth an afternoon. Four of the five are about a person using the page, and the search one is the least of them.
It takes a language tag, not a country
The value is a BCP 47 language tag: a language subtag, optionally followed by a script and a region. Almost every wrong value is somebody writing a country where a language belongs, or inventing a region that is not a country.
wrong why right
----------- ---------------------------- --------
en-UK the UK is GB in ISO 3166-1 en-GB
en-EU the EU is not a country en
es-LATAM nor is Latin America es-419
english not a language subtag en
EN case is not an error, and en
lowercase is the convention
zh ambiguous script zh-Hans
de_DE underscore, not hyphen de-DE
"" declares nothing, and looks omit it
like it was handled entirelyTwo of those deserve a note. es-419 is the correct way to say Spanish for Latin America: 419 is a UN region code, and region subtags accept those as well as country codes. And Chinese genuinely needs the script subtag, because zh-Hans and zh-Hant are simplified and traditional and a reader of one cannot comfortably read the other.
On whether to add a region at all: only when it changes something. en-GB against en-US affects spell checking and voice selection, so it is worth stating if you know. Where you have no regional variant to declare, the bare language subtag is correct and preferable to guessing.
A malformed value is discarded entirely rather than partially understood, which is the reason the heading of this section is worth the space. lang="en-UK" is not a slightly wrong English, it is nothing, and it looks like the attribute has been handled.
Check the attribute on one page
This reads the lang attribute on the URL you enter and reports whether it is present and whether it parses as a language tag, including the invented regions in the table above.
No signup required. Each free search audits one page, paste any URL to see it in action.
A pass means the value is well formed. Whether the text on the page is in that language is the harder half and a separate check.
Marking a passage in another language
The attribute is not limited to the html element. Any element can carry it, and that is the tool for a page that is genuinely mixed.
<html lang="de">
<body>
<p>Der Stahl rostet, wenn die Klinge nass bleibt.</p>
<!-- a quotation in another language, marked so it is read correctly -->
<blockquote lang="en">
Carbon steel will rust within hours if you leave it wet.
</blockquote>
<!-- a term nobody translates, marked so it is pronounced properly -->
<p>Wir empfehlen einen <span lang="ja">Toishi</span> mit 1000 Körnung.</p>
<!-- a language selector: each label in its own language -->
<a href="/fr/" lang="fr" hreflang="fr">Français</a>
<a href="/de/" lang="de" hreflang="de">Deutsch</a>
</body>
</html>The last pair is the detail almost every site gets wrong, and it is a nice illustration of two attributes doing different jobs. langsays what language this element's own text is in, so a link labelled Français should carry lang="fr" or a screen reader announces a French word in a German voice. hreflang says what language the destination is in. On a language selector they happen to match, which is why the distinction goes unnoticed.
This is also the honest way to ship a partially translated page.
If a section of a German page is still in English, wrapping it in lang="en" turns an inconsistency into a statement. A screen reader switches voice, the browser knows what it is looking at, and anything auditing the page can see the mixture was intentional.
It is not a substitute for translating the section. It is the difference between an incomplete page and a broken one, and it costs one attribute.
Does this affect AI search?
Modestly, and in a way worth stating precisely because the attribute is often oversold. Anything capable of reading your page can identify its language from the text, with more reliability than a declaration that might be a stale template default. So the attribute is not how a model works out what language you are in.
Where it does earn something is disambiguation at the edges. A short page, a page of mostly product names, or a page mixing two languages is genuinely ambiguous from text alone, and there the declaration is the tie-break. A page with fifty words on it is exactly the case where automatic detection is least reliable and the attribute costs nothing.
The per-element form has a clearer benefit than the page-level one. Marking a quotation, a term or an untranslated block tells anything reading the page that the mixture is deliberate, which is information no detector can infer: from the outside, an intentional English quotation and a failed translation look identical.
Why one attribute is rated Important
Because the accessibility failure is real and not a matter of degree. A page with no declaration read by a screen reader configured for a different language is not degraded, it is incomprehensible, and the person affected has no way to fix it from their side. That stands on its own before any argument about search.
It stays below Critical because nothing is excluded. Search engines determine language from content and index the page correctly without this, so no page is kept out of anything by its absence.
The rating is helped by how absurdly cheap the fix is. One attribute, in one layout template, applied to every page on the site at once, with no content work, no data and no judgement beyond knowing what language you publish in. There are very few findings in an audit with this ratio between the size of the change and the number of consumers that read it.
Questions this check raises
- What happens if the lang attribute is missing?
- A screen reader falls back to its own default voice, which may not match the page. For a user whose system language differs from the site, that means English read with the phonetic rules of another language, which is closer to noise than to accented speech. Browsers also lose the signal that decides whether to offer a translation.
- Should I use en or en-US?
- Either is valid, and the bare language tag is the safer default. Add the region only when the regional variation matters, such as pt-BR against pt-PT where vocabulary genuinely differs. An unnecessary region subtag is harmless; an incorrect one, such as en-UK, is not a real tag at all.
- How do I mark a quotation in another language?
- Put a lang attribute on the element containing it. A blockquote in French inside an English page gets lang="fr", and a screen reader switches voice for that passage and back again. This is the mechanism the attribute exists for, and it works at any depth.