Free tool
Hreflang Tag Generator
Build reciprocal hreflang annotations with correct ISO codes and an x-default fallback.
Hreflang must be reciprocal: every page in the set references every other page, including itself. Place the same block on every URL below.
Served when no language or region match applies.
<link rel="alternate" hreflang="en-US" href="https://example.com/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />About the hreflang tag generator
The reciprocity rule
Hreflang must be bidirectional. If page A points to page B, page B must point back to page A, and every page in the set must reference every other page including itself. One-way annotations are ignored entirely.
Codes people get wrong
Language uses ISO 639-1 (two letters, lowercase); region uses ISO 3166-1 Alpha-2 (two letters, uppercase). The order is language-REGION. UK is not a valid region code — the correct code is GB. There is no valid language code for Latin America, only regions.
Always include x-default
x-default tells search engines which page to serve when no language or region match applies. Without it, users outside your defined set get whatever the engine guesses.
Questions
Where should hreflang tags go?
In the HTML head, in the XML sitemap, or in HTTP headers. Pick one method and use it consistently — mixing methods is a common source of conflicting signals.
Do I need hreflang for the same language in different countries?
Yes, if you have separate URLs for en-GB and en-US. Without it, search engines may serve the wrong regional page, with visible consequences for currency and shipping.
One page at a time is slow.
Aeologic runs these checks across every URL you own and tells you which twenty to fix first.
7-day trial · No card required · Cancel anytime