Hreflang Tag Generator
Generate correct hreflang tags for any number of languages and regions. Bidirectional validation built-in, catches the most common hreflang mistake before deploy.
The only hreflang generator that catches the bidirectional mistake
Hreflang is the most commonly broken international SEO signal, and the most invisible. Your pages still rank, but Google serves the wrong language version to the wrong country, and you don't notice for months.
The fatal mistake: hreflang is bidirectional. If your English page links to your French page with hreflang="fr", the French page MUST link back to the English page with hreflang="en". Skip the return reference and Google ignores BOTH tags. This generator validates the bidirectional return for every page-pair, every time.
How hreflang actually works (in 3 sentences)
Hreflang tells Google: "this page exists in these other language and country variations." Google uses it to serve the right variant to the right user based on their language and location. It's NOT a ranking signal, it's a serving signal.
Language vs language-region
Use 2-letter language codes (en, es, fr) when you have one global version per language. Use language-region (en-GB, en-US, es-MX, es-ES) when content differs by country, pricing, currency, shipping. Don't mix the two on the same page-set.
Always include x-default
Add hreflang="x-default" pointing to your fallback page (usually English homepage). This catches users whose language doesn't match any of your variants, without it, Google guesses, often badly.
Three valid places to put hreflang, pick one
In the HTML <head> as <link rel="alternate" hreflang="…" href="…"/> tags. Most common. Easy to debug. The generator outputs this format.
In the XML sitemap as <xhtml:link> elements. Best for very large sites (10K+ pages) where adding tags to every HTML head is wasteful.
In the HTTP response Header for non-HTML content (PDFs, images, downloadable files).
Pick ONE method per site. Mixing methods causes Google to ignore both. Most sites should use HTML head tags for the first 5,000 URLs and switch to sitemap-based hreflang above that.