Hreflang Validator

Check an existing page's hreflang tags for missing self-references, missing x-default, and duplicate language codes.

What this checks & how to fix it

It reads every <link rel="alternate" hreflang="..."> tag in the page's <head>, resolves each destination to an absolute URL, and runs four checks: whether the page correctly references itself, whether an x-default entry exists when there are multiple real variants, whether any language code is duplicated across two different destination URLs, and whether each hreflang value looks like a valid language code.

How to fix what it finds

A missing self-reference is fixed by adding one more <link> tag to the page's own hreflang set, pointing at its own URL. Duplicate codes mean two entries are competing for the same language/region — pick the correct destination and remove the other. Malformed codes are almost always a typo, most commonly an underscore where a hyphen belongs (en_US instead of en-US). Once fixed, run the same URL back through this tool to confirm it comes back clean.

Frequently asked questions

What does 'self-reference' mean and why is it required?

A self-referencing hreflang entry is one that points back at the exact page it's declared on — for example, the English version of a page listing an hreflang="en" entry pointing at its own URL. Google's own documentation requires every page in a hreflang set to include itself this way. Skip it, and that page can be left out of the language/region targeting entirely, even though its sibling versions still reference it.

Why didn't it flag a missing reciprocal link on the other language version?

This tool only fetches the one URL you give it — it can't verify that your Spanish or French page actually links back with a matching hreflang set, since confirming that would mean crawling every language variant of your site, not just the page checked here. If you want that broader reciprocity check across your whole domain, Google Search Console's International Targeting report is the authoritative source — it's built specifically to catch mismatched or one-directional hreflang links between variants. For now, run each language version through this tool individually and compare.

Is x-default required?

No — it's optional. x-default tells search engines and browsers which version to serve a visitor whose language doesn't match any of the listed variants (for example, someone browsing in Japanese when you only have English and Spanish versions). It only becomes worth adding once a page has two or more real language/region variants; a single-language site, or a page with just one alternate, doesn't need it.

How is this different from the Hreflang Tag Generator?

The Hreflang Tag Generator builds a fresh set of hreflang tags from scratch — you list your language/region URLs and it outputs the markup to paste in. This tool does the opposite: it fetches a live page and checks the hreflang tags that are already there, catching missing self-references, duplicate codes, and malformed language values on pages that are already in production.

What counts as a malformed language code?

Anything that doesn't match the expected shape of a language code (like "en" or "es") optionally followed by a hyphen and a region or script subtag (like "en-US" or "zh-Hant"), or the special value "x-default". The most common real-world mistake is using an underscore instead of a hyphen — "en_US" instead of "en-US" — which most parsers and search engines will not accept as valid.

Related tools

Command Palette

Search for a command to run...