Hreflang Studio
100% client-sideBuild a validated alternate-language cluster — export as HTML tags, XML sitemap or HTTP headers.
1 Alternate cluster
0 alternatesShown to users whose language/region matches no other alternate.
2 Quick build
Bundles fill URLs from the pattern above when set — otherwise codes only.
Output
— Cluster checks
—Everything runs locally — your URLs are never sent anywhere. Reciprocal linking is verified on your pages, not here.
Hreflang Tag Generator
Roughly three quarters of international sites ship broken hreflang. Generate the full reciprocal cluster — self-references, return links, valid BCP 47 codes, x-default — as head tags or sitemap XML.
- Standard
- BCP 47
- Error rate
- ~73%
- Data sent
- 0 bytes
Three parts, one job
Every hreflang tag answers three questions for a crawler: what is this, who is it for, and where does it live.
Tells crawlers this URL is an alternate version of the current page — not a separate document competing with it.
A BCP 47 code: language alone (fr) or language + region (fr-ca). Targets the searcher, not the content format.
The fully qualified URL of that language/region version. Relative URLs work but absolute URLs remove all ambiguity.
en | All English speakers, any country | Language-only — broadest English targeting |
en-gb | English speakers in the United Kingdom | Different spelling, currency, shipping — same language |
es-mx | Spanish speakers in Mexico | Regional Spanish variants diverge meaningfully |
fr | French speakers worldwide | One French version serving France, Canada, Belgium… |
x-default | Everyone else / language selector | The catch-all — often the global English page |
Hreflang is a contract, not a suggestion
Google only honors the cluster when every page agrees. Break one rule and the annotation is ignored — not partially, entirely.
Self-reference
Every page must list itself in its own hreflang cluster. A missing self-reference is the single most common implementation error.
Return links
If page A points to page B, page B must point back to A. One-way links invalidate the pair — Google discards both.
Canonical alignment
The href must match the page's canonical URL. Hreflang pointing at a non-canonical URL sends two contradictory signals at once.
One-way hreflang is silently dropped. The generator emits the complete cluster for every URL — paste each page its own copy.
Three ways to serve the same cluster
Google treats all three identically. The right choice depends on your cluster size and how easily you ship changes.
HTML <link> tags
Most commonInside <head> - Best for
- Small-to-medium sites, teams that ship markup changes easily, and anyone who wants the tags visible in "view source".
- Watch out
- Large clusters (10+ locales) add real bytes to every page.
XML sitemap
Best at scaleIn sitemap <xhtml:link> entries - Best for
- Big multilingual sites — keeps head weight at zero and centralizes the whole cluster in one auditable file.
- Watch out
- Harder to debug; errors are invisible without sitemap tooling.
HTTP header
Edge casesLink: <url>; rel="alternate"; hreflang="…" - Best for
- Non-HTML assets — PDFs, downloadable files — and pages where you can't touch the markup at all.
- Watch out
- Rarely supported by CMSs; easy to lose in a migration.
The six errors behind ~73% of failures
Large-scale crawls consistently find broken hreflang on most international sites — and nearly all of it traces back to these six.
Missing return links
The #1 hreflang error. If the French page links to English but English never links back, Google ignores the annotation entirely.
No self-referencing tag
Each page must declare itself. A cluster where en-us never says "I am en-us" is treated as incomplete.
Invalid language codes
en-UK isn't a code — the UK is en-GB. Language must come first, region second (es-mx, never mx-es), and "x-default" is not a language.
Hreflang on non-canonical URLs
If /fr/page canonicalizes to /fr/page/, hreflang must point at /fr/page/ — the canonical target — not the redirecting variant.
Forgetting x-default
Without x-default (or a fallback locale), users outside your targeted regions get whichever version Google guesses.
Mixing signals
Hreflang cluster says one thing, canonicals and internal linking say another. Google resolves conflicts by ignoring hreflang first.
Three steps to a valid cluster
- 01
Add each locale + URL
Enter every language/region version and its canonical URL. The generator validates BCP 47 codes as you type — en-gb yes, en-UK no.
- 02
Pick your fallback
Choose which URL serves unmatched users via x-default — usually your global English page or a language selector.
- 03
Copy head tags or sitemap XML
Export the cluster as <link> elements for your <head> or as xhtml:link entries for your sitemap — every page gets its full, reciprocal set.
Hreflang questions, answered
Return links, x-default, canonical interplay, and head vs sitemap delivery.
01 What is an hreflang tag?
Hreflang is an annotation (usually a <link rel="alternate" hreflang="…" href="…"> element) that tells search engines which language and regional audience each version of a page serves. Google uses it to show the French page to a searcher in Paris and the English page to one in Toronto — instead of picking arbitrarily.
02 What does "x-default" do?
x-default marks the URL served to users who match none of your declared locales — typically a global English page or a language/region selector. It's optional but strongly recommended: without it, Google guesses which version unmatched searchers see.
03 Do hreflang tags need to be reciprocal?
Yes — this is the rule that breaks most implementations. If your English page declares the Spanish page as an alternate, the Spanish page must declare the English page back. Each page also needs a self-referencing tag. Missing return links cause Google to ignore the annotations.
04 What's the difference between hreflang and canonical?
Canonical picks one master URL among duplicates; hreflang says "these are all legitimate — show each to a different audience." They work together: each locale version self-canonicalizes, then hreflang links the canonicals. Never canonicalize your German page to the English one if you want it indexed.
05 How common are hreflang errors?
Very — large-scale crawls have found implementation errors on roughly three quarters of international sites. Missing return links, missing self-references, invalid BCP 47 codes, and hreflang pointing at non-canonical URLs account for most of them. Generating the cluster mechanically eliminates the typo class entirely.
06 Should hreflang go in the <head> or the sitemap?
Both work identically for Google. Head tags are easier to inspect and debug; sitemap implementation scales better for large clusters and keeps pages lighter. Pick one method and apply it consistently — mixing methods across pages is allowed but makes audits painful.
More generators for global sites
Hreflang done? Align your canonicals, sitemap, and meta tags next.
Canonical Tag Generator
Generate canonical link tags to prevent duplicate content issues.
XML Sitemap Generator
Create XML sitemaps for search engines to crawl your site efficiently.
Meta Tag Generator
Generate HTML meta tags for title, description, viewport, and more.
Open Graph Generator
Create social media preview tags for Facebook, Twitter, and LinkedIn.