HTML Lang Attribute Checker

Last updated:

Check the lang attribute on any page in seconds. We read the html element, validate the language tag against BCP 47, report text direction, and flag missing or mismatched values that hurt accessibility and SEO.

Enter a URL to check its lang attribute:

How the Checker Works

  1. Safe fetch, the host is validated before our server requests the page.
  2. Read the html tag, the lang, xml:lang, and dir attributes are extracted.
  3. Validate, the language tag is checked against BCP 47 syntax.
  4. Report, you get the values, the primary language, and any issues.

Why It Matters

  • Accessibility, screen readers pick the right voice and pronunciation.
  • Correct rendering, browsers apply language-specific typography and hyphenation.
  • Translation, tools detect the source language accurately.
  • SEO support, it reinforces page language alongside hreflang.

Language signals are one small piece of technical and international SEO, and getting the whole stack right is the kind of work our SEO services handle end to end.

Common lang Attribute Values Reference

The lang value follows BCP 47: a primary language subtag on its own, or a language-REGION pair when you need to specify a regional variant. The table below lists values you will see most often, including a right-to-left example.

ValueLanguage / regionNote
enEnglish (no region)Generic English; fine when no regional variant is needed.
en-USEnglish, United StatesUS spelling, date, and number conventions.
en-GBEnglish, United KingdomUK spelling and conventions.
esSpanish (no region)Generic Spanish.
es-ESSpanish, SpainEuropean (Castilian) Spanish.
frFrench (no region)Generic French.
fr-CAFrench, CanadaCanadian French.
deGermanGeneric German.
pt-BRPortuguese, BrazilBrazilian Portuguese (pt-PT for Portugal).
zh-HansChinese, Simplified scriptScript subtag; zh-Hant for Traditional.
arArabic (RTL)Right-to-left; also set dir="rtl" on the html element.

Format reminder: use the language subtag alone (en) or language-REGION (en-US), following BCP 47. Lowercase the language, title-case any script (Hans), and uppercase the region (US).

Next steps

HTML Lang Attribute Checker related tools and articles

Continue with the closest follow-up checks and guides based on this tool's topic, crawl intent, and optimization workflow.

HTML Lang Attribute Checker: FAQ

What exactly does the checker inspect?
It fetches the submitted public page and reads the opening html element from the returned HTML. It reports lang, xml:lang, dir, the primary language subtag, the final URL after redirects, and the HTTP status.
What does a valid result mean?
Valid means a lang value was present and matched this checker's language-tag pattern: a two- or three-letter primary subtag followed by optional 2-to-8-character subtags. It is a useful syntax check, not a complete registry lookup for every BCP 47 rule.
Why can a syntactically valid lang value still be wrong?
The checker cannot determine whether the declared language matches the page's actual writing. Review the result against the main content language, and use region or script subtags only when they are genuinely needed.
How are lang and xml:lang handled?
The HTML lang attribute is the main value. If xml:lang is also present, the tool reports it and flags a case-insensitive mismatch. A missing xml:lang is not treated as an issue for ordinary HTML pages.
Does the checker validate right-to-left direction?
It reports the dir attribute when present, but it does not decide whether ltr, rtl, or auto is correct for the content. For languages such as Arabic or Hebrew, verify direction and mixed-direction components in the rendered page.
Why might the checker miss a lang attribute I can see in the browser?
It analyzes the server-returned HTML, up to 512 KB, rather than executing page JavaScript. A client-side framework that adds or changes lang after load will not be reflected. Timeouts, bot protection, or a non-public host can also prevent the fetch.
What should I change when lang is missing?
Set a language tag on the root html element in the server-rendered document, for example lang="en". On multilingual sites, make sure each localized page emits its own correct value rather than inheriting one site-wide default.
What data leaves my browser during a check?
The URL is sent to Web Aloha's server so it can fetch the public page. The endpoint returns the parsed html-tag details and does not include application logic that persists the fetched page or result, but normal infrastructure logs may still record requests.

Free 48-Hour Website Audit

Not sure what to fix first on your own website? We'll review it and tell you, in plain English. Free & non-obligatory.

Want an Accessible, Search-Ready Site?

We build websites that meet accessibility standards and rank well, with correct language signals baked in.