Live
PRO
Hreflang Generator
Correct multi-language tags.
How this tool works
Hreflang is the signal that tells Google which version of your page to serve based on user language and country. Without hreflang, Google may show a Mexican user the English version of your site (bad UX, high bounce) or compete against yourself between /es and /en (keyword cannibalism).
This generator produces hreflang in two formats: tags for each page's
, and XML entries for a multi-language sitemap (Google-recommended for sites with 100+ translated pages). Detects common errors: missing self-reference, no x-default, regions without ISO 3166 code.Frequently asked questions
- HTML head or sitemap?
- Small sites (<100 translated URLs): tags. Large sites: XML sitemap β easier to maintain and edit at scale.
- What is x-default?
- The fallback page when no hreflang matches the user. Use the most universal version (typically global English or the original language).
- Do I need country codes?
- Not always. 'es' = generic Spanish (all Spanish-speaking countries). 'es-MX' = Mexico-specific Spanish. Only use country if you have region-specific content (prices, laws).
- Why isn't it working?
- Common errors: (1) missing self-reference β each page must link to itself with its own hreflang, (2) non-canonical URLs β hreflang must point to canonical URLs, not redirects, (3) bilateral inconsistency β if A links to B, B must link to A.