Hreflang Tag Generator
Build valid hreflang link tags, HTTP Link headers and XML sitemap alternates for every locale you target. Catches invalid codes, missing x-default and case mistakes before they reach Google.
Locale & URL pairs
Add one row per language/region
Use ISO 639-1 language codes (lowercase) and optional ISO 3166-1 region (UPPERCASE). Include x-default as a fallback.
Quick-insert locale
Click any common locale to slot it into the next empty row (or append a new row).
Generated Tags
HTML — paste in <head>
<link rel="alternate" hreflang="en-AU" href="https://workspacein.com/en-au/" /> <link rel="alternate" hreflang="en-US" href="https://workspacein.com/en-us/" /> <link rel="alternate" hreflang="en-GB" href="https://workspacein.com/en-gb/" /> <link rel="alternate" hreflang="x-default" href="https://workspacein.com/" />
HTTP Link header (for PDFs / non-HTML)
Link: <https://workspacein.com/en-au/>; rel="alternate"; hreflang="en-AU", <https://workspacein.com/en-us/>; rel="alternate"; hreflang="en-US", <https://workspacein.com/en-gb/>; rel="alternate"; hreflang="en-GB", <https://workspacein.com/>; rel="alternate"; hreflang="x-default"
XML Sitemap entry
<url>
<loc>https://workspacein.com/en-au/</loc>
<xhtml:link rel="alternate" hreflang="en-AU" href="https://workspacein.com/en-au/"/>
<xhtml:link rel="alternate" hreflang="en-US" href="https://workspacein.com/en-us/"/>
<xhtml:link rel="alternate" hreflang="en-GB" href="https://workspacein.com/en-gb/"/>
<xhtml:link rel="alternate" hreflang="x-default" href="https://workspacein.com/"/>
</url>- infoTags look valid — remember to add them to every URL in every locale (return links are required).
How to Deploy Hreflang Correctly
Four rules Google enforces — miss any one of them and the tags are ignored, silently.
Every page references every page
If /au links to /us, /us must link back to /au. Missing return references cause Google to drop the cluster entirely — no geo-targeting applied.
Always include x-default
x-default is the fallback shown to users whose locale isn't explicitly listed. Pair it with your flagship page (often the language-picker or global default).
Use absolute URLs, fully-qualified
hreflang hrefs must include protocol (https://) and full hostname. Relative URLs are silently ignored.
Pick one method — don't mix
HTML link tags, HTTP Link headers, OR XML sitemap alternates. Using two on the same page can create conflicts. HTML tags are simplest; sitemaps scale best.
Hreflang Code Reference
The building blocks — what's valid, what's not, and where teams get it wrong.
Language only
Two-letter ISO 639-1, lowercase. en, es, fr, de. Use when you don't need country targeting.
Language + region
ISO 639-1 + ISO 3166-1, hyphen, region UPPERCASE. en-AU, pt-BR, zh-CN.
x-default
Reserved value for fallback. One per page cluster. Points to the URL you want shown when no match exists.
Script codes
Rare. Four-letter ISO 15924 between language and region. zh-Hans-CN (Simplified) vs zh-Hant-TW (Traditional).
UK is "GB"
British English is en-GB, not en-UK. "UK" is not a valid ISO 3166-1 code.
Not valid
Underscores (en_AU), lowercase region (en-au is tolerated but not canonical), three-letter regions, country name words.
Self-reference required
Each URL must include a hreflang tag pointing to itself as well as to its siblings. Missing self-reference = invalid cluster.
Canonical matters
hreflang alternates should all be canonical URLs. Pointing to a non-canonical URL (or one that redirects) invalidates the entry.
What Hreflang Gets You — and What It Doesn't
Hreflang is a targeting hint, not a ranking boost. Know what it fixes before you deploy.
What it fixes
Common mistakes
What it doesn't do
Where to implement
Hreflang FAQ
Do I need hreflang if I only sell in Australia?
No. Hreflang is for sites with multiple language or country versions of the same page. If you have one AU site and that's it, skip it — canonical tags are enough.
What's the difference between en-AU and en?
en-AU targets English speakers in Australia. en targets English speakers anywhere without country preference. Use en-AU for Australia-specific pricing, shipping, or content.
Will this replace my canonical tag?
No. Hreflang and canonical serve different jobs. Each locale page should self-canonical and also list its hreflang alternates. Both coexist in the same <head>.
Does Bing or Baidu use hreflang?
Bing mostly respects it. Yandex supports it. Baidu does not — use meta language tags for Chinese targeting instead.
Going Multi-Region? Get an International SEO Audit.
Our Australian SEO team runs hreflang, canonical, sitemap and indexing audits across every locale — and hands you a prioritised fix list.
- hreflang cluster check
- canonical + sitemap audit
- No lock-in commitment
No long-term commitment. Cancel anytime. 100% satisfaction guaranteed.
