Skip to main content
Free Tools

Hreflang tag generator

Build valid, reciprocal hreflang annotations for your international site - as HTML tags, sitemap entries, or HTTP headers, with x-default and live validation.

No signup required3 output formatsLive validation

Language versions

x-default tells search engines which page to serve when no language matches.

3 alternates

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

Place this full set of tags in the <head> of every listed page (each page must reference all alternates, including itself).

Valid hreflang set with 3 alternates (including x-default).

Don't forget reciprocal tags

hreflang must be reciprocal: every page in the set must link to all the others (and itself). If your English page points to the French one, the French page must point back - or Google ignores the annotations. The set above is the full reciprocal block to place on every listed page.

Launching a multilingual site?

International SEO is easy to get subtly wrong. We build multilingual sites with correct hreflang, sitemaps, and structure from the start.

Talk to an engineer

Quick answer: Hreflang tags tell search engines which language and regional version of a page to serve to which users. This generator builds valid, reciprocal hreflang markup - as HTML link tags, XML-sitemap entries, or HTTP headers - including the x-default tag, so Google serves the right page to the right audience and you avoid duplicate-content issues.

The three ways to implement hreflang

MethodBest for
HTML link tagsMost sites; simple to add to each page's <head>
XML sitemapLarge sites; keeps markup off the page and scales well
HTTP Link headerNon-HTML files like PDFs

Pick one method per set of URLs - don't mix HTML tags and sitemap entries for the same pages.

Language & region code examples

hreflangTargets
enEnglish speakers, any region
en-USEnglish speakers in the United States
en-GBEnglish speakers in the United Kingdom
fr-CAFrench speakers in Canada
x-defaultFallback when no language matches

Language uses ISO 639-1 (2 letters); region uses ISO 3166-1 Alpha-2 (2 letters). Language is required, region is optional.

The most common hreflang mistakes

  • Missing return (reciprocal) tags - every page must reference all the others, or Google ignores the set.
  • Wrong codes - using a country code as a language (e.g. "uk" for Ukrainian, which is actually "ua" region / "uk" language is Ukrainian - easy to confuse) or inventing codes.
  • No x-default - leaving users with no fallback when their language isn't covered.
  • Relative URLs - hreflang requires absolute, fully-qualified URLs.
  • Non-canonical targets - hreflang URLs should be self-canonical, not pointing at a different canonical.

Frequently asked questions

What are hreflang tags?
Annotations that tell search engines which language/region version of a page to serve, preventing duplicate-content issues.
What is x-default?
The fallback version shown when no language/region matches the user - often a selector page or your global version.
HTML, sitemap, or HTTP header?
All valid - pick one. HTML for normal pages, sitemap for scale, HTTP header for non-HTML files.
Do tags need to be reciprocal?
Yes - every page must link to all others including itself, or the annotations are ignored.
Which codes does hreflang use?
ISO 639-1 language (en, fr) optionally with ISO 3166-1 Alpha-2 region (en-US, fr-CA).

Related tools

Launch Faster

Ready to ship your next product?

Tell us what you're building. Senior engineers will scope, plan, and start delivering your product with production-ready architecture - fast.

Talk to real engineers
Clear scope in one call
No obligation