Checks

HTML lang attribute

Checks that the html element declares a valid BCP-47 language code, the primary signal browsers, screen readers, and search engines use to identify a page's language.

Updated 2026-07-19minorInternationalization

What this check looks for

This check reads the lang attribute on the <html> element. If empty or absent, it fails. If present but not a valid BCP-47-style tag (a base language code with optional region/script subtags, like en or en-US), it warns, quoting the invalid value. A valid lang attribute passes, reporting the declared language.

Why it matters

The lang attribute tells screen readers which pronunciation rules and language-specific voice to use — get it wrong or leave it blank, and assistive technology may read the page aloud with completely wrong pronunciation. Search engines use it as one signal (alongside hreflang and content analysis) to serve the right language version of a page to the right audience, and browsers use it to decide whether to offer an automatic translation. AI answer engines processing multilingual content rely on the same declared language to correctly interpret the text and to know which language to respond in when citing or quoting the page.

How to fix it

Declare an accurate language tag on the html element:

html
<html lang="en">
html
<!-- Region-specific variant -->
<html lang="en-US">

If the page mixes languages in specific sections (a quote in French within an English article, for example), you can additionally set lang on that specific element without changing the page-level declaration.

See how your site scores on this check

Run a free scan

See how your site scores on this check.

The free teaser scan checks a sample of your pages — no account, no card.