Skip to main content
Free Tool

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.

ISO locale validationx-default detectionHTML / Header / SitemapDuplicate detectionRegion case checkOne-click presetsIn-browser onlyAustralian SEO

Locale & URL pairs

1

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.

Locale
URL
2

Quick-insert locale

Click any common locale to slot it into the next empty row (or append a new row).

Generated Tags

Status4 hreflang tags ready

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>
Issues
  • 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.

1

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.

2

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).

3

Use absolute URLs, fully-qualified

hreflang hrefs must include protocol (https://) and full hostname. Relative URLs are silently ignored.

4

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

Wrong-country URL in SERPDuplicate content across localesUS page ranking in AUMixed-language resultsCurrency/shipping confusionLocale cannibalisation

Common mistakes

Missing return linksen-UK instead of en-GBRelative URLsNo x-defaultUnderscore separatorNon-canonical URLs

What it doesn't do

Boost rankings directlyConsolidate duplicatesReplace canonical tagsForce a locale to usersStop geo-IP redirectsAffect Bing the same way

Where to implement

HTML <head>HTTP Link headerXML sitemap alternatesCDN edge logicNext.js i18n configAngular meta service

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
Book a Free Consultation First
🔒 Secure checkout|Delivered within 48 hours|100% money-back guarantee

No long-term commitment. Cancel anytime. 100% satisfaction guaranteed.