1001Ferramentas
🌍Validators

hreflang vs lang Consistency Checker

Compares the html lang attribute with the main link hreflang value and flags an exact match, the same base language with a different region, or a mismatch.

Result

When the page lang and the link hreflang disagree

Two language declarations coexist on an internationalised page: the language attribute on the root element, saying what language the content is in, and the hreflang on alternate links, saying who each version serves. When the two disagree, the search engine receives contradictory information and a screen reader may pronounce the text with the wrong phonetics.

Enter both values and the page compares them. It distinguishes three situations: identical, the desired case; same base language with different regions, which is a warning rather than necessarily an error; and different languages, which is a genuine inconsistency. The distinction matters because Brazilian and European Portuguese, or American and British English, are legitimate cases of regional divergence.

Worth remembering the formatting rules: the language code goes lowercase and the region uppercase, hyphen-separated — the comparison here normalises case, but validation tools complain. And hreflang is reciprocal: if page A points at B, then B must point back at A, or the search engine ignores the pair entirely.

Frequently asked questions

Is a regional divergence always an error?
No. A page in Brazilian Portuguese may legitimately carry an alternate link with a European Portuguese hreflang pointing at the other version. What must not happen is the page's own language attribute diverging from the hreflang pointing at it — there the content is declared as one language and offered as another.
Do I need the undetermined-language value?
It serves the version catering to anyone who fits none of the declared ones — usually a selection page or an international English version. It is not mandatory, but it helps when the site covers few languages and receives visits from many places.
What does the language attribute actually affect?
A screen reader picks its voice and phonetics from it — text in one language read with another's phonetics is unintelligible. Browsers use it to offer translation and to choose hyphenation rules. And search engines weigh it alongside other signals when deciding who to show the page to.

Related Tools