Free Hreflang Tag Generator
Create correct hreflang tags for multilingual and multi-regional websites. 180+ languages, 250+ regions, x-default support and live validation. No sign-up required.
Configure Language Versions
Generated Hreflang Tags
<head> of every language version of the page. If page A links to page B with hreflang, page B must link back. Include a self-reference to the current page too.
What Is Hreflang?
Hreflang is an HTML attribute that tells Google which language and geographic region a page is targeting. It is used on multilingual and multi-regional sites to make sure users see the correct language version in search results.
For example, if you have an English page for the US and an English page for the UK, hreflang lets you tell Google: "Send US users to the .com/en-us/ version and UK users to the .com/en-gb/ version."
The hreflang tag format
There are three valid formats for the hreflang attribute:
enโ language only (any English-speaking user)en-USโ language + region (English speakers in the United States specifically)x-defaultโ fallback for users whose language/region is not covered
Do you need hreflang?
You need hreflang if any of these apply:
- Your site has content in multiple languages
- You target different countries with the same language (US vs UK vs Australia)
- You have regional stores with different prices, currency or products
- You serve different content based on the user's location
You do not need hreflang if your site is in one language and one country. A single-language site has nothing to disambiguate.
The 5 hreflang rules you must follow
- Hreflang must be reciprocal. If page A points to page B, page B must point back to page A. Google ignores non-reciprocal pairs.
- Every page needs the full set. Not just the tags pointing to other languages โ every language version must contain tags for all versions, including itself (a self-reference).
- Always include x-default. It tells Google which page to show when no language matches. Usually your language selector or global English page.
- Use the correct ISO codes. Language codes are ISO 639-1 (two letters:
en,fr,de). Region codes are ISO 3166-1 alpha-2 (US,GB,DE). Never use both region and script together. - Use absolute URLs. Hreflang URLs must be absolute:
https://example.com/en-us/, not/en-us/.
Three ways to implement hreflang
- HTML link tags โ inside the
<head>of each page. Easiest for small-to-medium sites and what this tool generates. - HTTP headers โ for non-HTML files like PDFs. Sent as
Link: <https://example.com/en>; rel="alternate"; hreflang="en". - XML sitemaps โ using
xhtml:linkelements. Best for sites with thousands of pages.
Common hreflang mistakes
- Non-reciprocal tags. Page A points to B, but B doesn't point back. Google ignores both.
- Missing x-default. Users whose language isn't covered see the "wrong" version.
- Using region as language.
hreflang="uk"doesn't mean "United Kingdom" โ it means "Ukrainian." Useen-GBfor UK English. - Wrong codes.
en-UKis invalid โ the UK country code isGB. Always useen-GB. - Pointing to redirecting or 404 URLs. Both endpoints must return 200 OK.
- Using uppercase region codes inconsistently.
en-usanden-USare equivalent, but be consistent. - Conflicting with canonical. If a page has a canonical pointing to another URL, that URL must also be the hreflang target.
Frequently Asked Questions
What is hreflang?
Do I need hreflang?
What is x-default?
x-default tells Google which page to show when no language or region matches the user. It is typically your language selector page or your global English version. Every hreflang set should include one x-default.