All tools
Free SEO tool

Hreflang tag generator + checker

Build a reciprocal hreflang block for every language and region you serve, with x-default and live validation of language/region codes.

Hreflang tags
<link rel="alternate" hreflang="en-US" href="https://example.com/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Valid — 3 hreflang tags + x-default.

Hreflang tags must be reciprocal — every page in the set should list every other variant, including itself. Place the same block on every language version.

What hreflang does

hreflang tells Google which version of a page to show users based on their language and country. A US visitor lands on the en-US page, a UK visitor on en-GB, a Spanish visitor on es-ES — instead of all of them being served whichever version Google happens to prefer.

It doesn't change rankings, but it dramatically changes which URL ranks for which user. Without hreflang, your en-GB content may show up for a US searcher with the wrong currency, spelling, and shipping options — a worse experience that translates directly into a lower conversion rate.

How to structure hreflang tags

Place the same hreflang block in the <head> of every language variant of the page. Each tag uses a 2- or 3-letter ISO 639-1 language code, optionally followed by a hyphen and a 2-letter ISO 3166-1 region code.

  • Always include a self-referential hreflang tag on every page.
  • Reciprocity is mandatory — every page in the set must list every other.
  • Use lowercase for language codes (en) and uppercase for region codes (US).
  • Always declare an x-default fallback for users who don't match any locale.
  • URLs in the href attribute must be absolute (https://…) and return 200.
  • Don't combine hreflang with a canonical that points at a different language — they conflict.

Common hreflang mistakes the checker catches

Most hreflang failures come from typos and structural omissions, both of which the validator surfaces immediately. The most-common errors: typo'd language codes (en-USA instead of en-US), region codes used where a language code belongs (using US alone instead of en-US), missing x-default, and duplicate codes across rows.

What it can't validate (because it has no crawler) is reciprocity. Run the same block on every variant page and confirm in Search Console under Indexing > International Targeting once it's live. The flow there shows missing reciprocal links per URL.

FAQ

Do I need hreflang if I only target one country?+

No. Hreflang is for sites that publish the same content in multiple languages or for multiple regions. If you have a single English site for global readers, skip it — Google will treat the page as one universal version.

What does x-default do?+

x-default is the fallback URL Google serves when a user's language/region doesn't match any of your declared variants. A US-English user visiting a site that only lists en-GB and de-DE versions would land on the x-default. Always declare one.

Do hreflang tags need to be reciprocal?+

Yes. Each page in a language set must list every other variant — including itself. If your English page links to a Spanish version, the Spanish version must link back. Missing reciprocals are the single most common hreflang bug.

Want this checked sitewide, automatically?

7-day trial. From $29/mo. Cancel from the dashboard.