Warning Missing lang attribute on <html>
Why every page should declare its language with <html lang="en">, and how it affects screen readers, translation, and SEO.
The validator warns when the root <html> element has no lang attribute.
Example
<!-- Wrong -->
<html>
<!-- Right -->
<html lang="en">
<html lang="en-GB">
<html lang="sv">Use a two-letter ISO 639-1 code, optionally with a region subtag (en-US, pt-BR). If different sections of a page are in different languages, you can also set lang on individual elements — it inherits down from <html> otherwise.
Why it matters
Screen readers use lang to choose the correct pronunciation and voice for text-to-speech — without it, a screen reader typically falls back to the user's system language, which can badly mispronounce content in a different language. Browsers use it to offer accurate auto-translation, and search engines use it as a signal for serving the right language version of a page to the right audience.
Frequently asked questions
What value should lang have for a multilingual page?
Set lang on <html> to the page's primary/majority language, then override it on specific elements or sections written in a different language — for example <blockquote lang="fr">...</blockquote> inside an English page.
Is a language code enough, or do I need a full locale?
A bare two-letter code like en or sv is valid and sufficient in most cases. Add a region subtag (en-US vs en-GB) only when the distinction actually matters for your content — spelling, currency, date formats, and so on.