Hreflang Checker

Validate hreflang tags: language codes, self-reference, x-default and return links on every alternate.

What is hreflang?

Hreflang is an HTML attribute that tells search engines which language and country each version of a page is for, so Google shows the right version — for example English for the UK or Spanish for Mexico — to each user.

What the checker validates

  1. Codes — language in ISO 639-1 (en, es, de), optionally followed by a region in ISO 3166-1 (en-gb, es-mx). Common mistakes such as en-uk are flagged.
  2. Self-reference — each page must list itself.
  3. x-default — the fallback page for users whose language is not listed.
  4. Duplicates — one URL per code.
  5. Return links — each alternate page must link back; otherwise Google ignores the pair.
  6. Status — alternates must return 200, not redirects or errors.

Example

<link rel="alternate" hreflang="en-gb" href="https://example.com/uk/">
<link rel="alternate" hreflang="en-us" href="https://example.com/us/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">

Hreflang tags can also be set in the HTTP Link header (useful for PDFs) or in an XML sitemap. This tool checks the HTML and the HTTP header.

Frequently asked questions

Is en-UK a valid hreflang code?

No. The ISO country code for the United Kingdom is GB, so use en-gb.

Do I need x-default?

It is optional but recommended. It tells Google which page to show when none of your language versions match the user.

Why are my hreflang tags ignored?

The most common reason is missing return links: every page in the set must reference every other page, including itself.