Language attribute checker
Get the HTML language attribute of a webpage and see how its language is declared.
Latest submissions
What the language attribute checker does
This tool reads the lang attribute from the HTML element of a webpage and displays its value. It shows how the page declares its primary language to browsers, assistive technology, and search engines.
The language attribute is a short code, such as en for English or fr for French. It can include a region subtag, such as en-US or pt-BR. The declaration applies to the whole document unless overridden on individual elements.
Why the language attribute matters
Screen readers use the language declaration to select the correct pronunciation rules. If a page is marked as English but contains French text, the screen reader may mispronounce it. Correct declarations make content more accessible to users who rely on assistive technology.
Browsers use the attribute for hyphenation, spell checking, and font selection. Search engines use language signals to serve content to the right audience, and translation tools rely on accurate declarations. For multilingual sites, the language attribute works alongside hreflang annotations to clarify which language and region each page targets.
How to interpret the result
Check that the declared value matches the page's actual primary language. A missing attribute means no language is declared, which can lead to incorrect pronunciation and weaker language signals. A mismatched value, such as en on a Spanish page, is worse than a missing one because it actively misinforms.
Use the shortest code that accurately represents the content. Region subtags are useful when content differs by locale, such as en-GB versus en-US. Avoid overly specific codes that do not correspond to real language variants, and ensure the attribute is valid according to the language code standard.
Common language attribute issues
- Missing lang attribute. No language is declared for the document.
- Wrong language code. The declared code does not match the content.
- Using a country code instead of a language code. Values like
UKare not valid language declarations. - Unmarked foreign passages. Quotations or excerpts in another language should carry their own lang attribute.
- Inconsistent declarations across a multilingual site. Each language version should declare its own language.
Practical workflow
Check the main language versions of the site and confirm each declares the correct language. Review pages that mix languages and add inline language attributes to foreign passages where practical. After template changes, re-check the attribute, since a theme update can remove or overwrite it.
Limitations
The checker reports the attribute on the HTML element in the response it receives. It does not evaluate inline language overrides or verify hreflang configurations.
Similar tools
Check whether a webpage declares its character encoding and which encoding it uses.
Extract and verify the meta tags of any webpage.
Check whether a webpage has an HTML doctype declaration and review its value.
Popular tools
Check whether images on a webpage have alt attributes for accessibility and image SEO.
Measure the total size of a webpage, including all loaded resources.
Check whether a page is set to noindex through meta tags, HTTP headers, or robots.txt.
Compare the amount of visible text to HTML code on a webpage.