What Is hreflang? A Complete Guide With Examples
hreflang is an annotation that tells search engines which language, and optionally which region, a page is written for, and where the other versions of that same page live. Google uses it to show searchers the version that fits their language or location instead of a different one. It does not translate anything and it does not move a page up the rankings; it connects pages that already exist.
Why does hreflang exist?
A site with several language versions has a problem: the same page may exist in English, French and German, and a search engine has to decide which one to show to whom. Without help, it relies on the visible language of each page and other signals. Google's documentation explains that it determines language from the visible content and says it does not use code-level language information such as the lang attribute or the URL for that purpose.
hreflang is the explicit signal for the other question: which pages are alternates of each other. It is most useful in these cases:
- The same language is targeted at several regions with small differences, such as
en-USanden-GBpages with different currency or spelling. - Content is fully translated into several languages and you want each audience to see its own version.
- Only the page template is translated while the main content stays the same, which is a weaker case and is discussed in Google's international guidance.
It is not a way to make a poor translation acceptable, and it is not required for a multilingual site to be indexed. Our guide to subdirectories, subdomains and ccTLDs covers the structural choice that comes before it.
What does hreflang syntax look like?
The most common form is a link element in the head of each page. The following is the pattern in Google's documentation:
<link rel="alternate" hreflang="lang_code" href="url_of_page" />
A concrete set for a page available in English, French and German:
<link rel="alternate" hreflang="en" href="https://example.com/en/pricing/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/preise/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
This exact block goes on all three pages, not just one. Google documents three equivalent ways to deliver the annotations: HTML tags, HTTP headers and XML sitemaps. We compare them in hreflang implementation methods.
Which language and region values are valid?
According to Google, the value is a language code in ISO 639-1, optionally followed by a region code in ISO 3166-1 Alpha 2. The value is case-insensitive.
| Value | Meaning | Valid? |
|---|---|---|
en |
English, any region | Yes |
en-GB |
English for the United Kingdom | Yes |
fr-CA |
French for Canada | Yes |
zh-Hant |
Traditional Chinese script | Yes, script codes (ISO 15924) are supported |
GB |
Region only | No, a region cannot be given by itself |
be |
Belarusian language, not Belgium | Valid code, but a common mistake when Belgium was meant |
es-419 |
Latin American Spanish | Not supported according to Google |
x-default |
Fallback page | Yes, a special value |
Two points cause most of the trouble. First, the language comes first and the region second, so en-GB is right and gb-en is not. Second, reserved or unofficial region codes, such as UK for the United Kingdom, have no effect; the ISO code is GB. Our reference on language and region codes goes through the common cases.
What is x-default?
x-default marks the page to use when none of your listed languages match the user. Google says it was designed for language selector pages, although it can point to any fallback page you choose. It takes no language code:
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
It is optional. If you have a language chooser or a page that works well as a generic landing page, it is a sensible choice. If you have none, leaving it out is acceptable.
What are return links and why do they matter?
hreflang is a two-way relationship. Google's documentation states that if two pages do not both point to each other, the tags will be ignored. Suppose your German page declares your English page as an alternate. The English page must also declare the German page. This rule exists so that one site cannot claim another site's page as its alternate without that page's agreement.
In practice it means every page in a group carries the same complete list. That includes a link to itself, the self-reference. Google says each language version must list itself as well as all the other versions. The set of links should be identical on every page in the group, which is why generating them from one template or data source is far safer than writing them by hand.
How do you write fully-qualified URLs?
The href values must be fully-qualified, including the protocol (https://). Google states that relative and protocol-relative URLs are not valid for hreflang. These are wrong:
<link rel="alternate" hreflang="fr" href="/fr/tarifs/" />
<link rel="alternate" hreflang="fr" href="//example.com/fr/tarifs/" />
And this is right:
<link rel="alternate" hreflang="fr" href="https://example.com/fr/tarifs/" />
Use the exact URL that the target page considers canonical, with the same protocol, host, trailing-slash convention and path. A mismatch is one of the most common reasons annotations fail; see hreflang mistakes for the full list and canonical tags on multilingual sites for how the two signals interact.
Do all search engines read hreflang?
Google documents hreflang in its Search Central pages. Bing is less clear-cut. A December 2025 post on the Bing Webmaster blog advises using hreflang to define language and regional targeting, so it is recommended there. We did not find Bing documentation that spells out the details of how it processes hreflang, so treat the exact behaviour as unverified, and do not assume it matches Google's. Older Bing guidance from 2011 also described a content-language meta tag and HTTP header; that is legacy material, and we could not confirm that it reflects current behaviour.
Practically, an accurate hreflang set is cheap insurance and harmless for other engines. Keep the pages themselves clearly in one language, with a correct lang attribute for browsers and assistive technology, and do not rely on any single annotation.
How do you check that hreflang works?
- Open a page and confirm that it lists itself and every alternate.
- Open each alternate and confirm that it lists the first page back.
- Request each URL and check that it returns a 200 status, is not blocked by robots.txt and is not set to
noindex. - Compare the URLs character for character with each page's canonical URL.
- Re-check after any migration, slug change or plugin update, since templates generate these tags.
If you do not run this check regularly, errors tend to accumulate silently. We are building ResilientLang so that the hreflang set for a page is generated from one source of truth rather than maintained by hand, but it is not released yet, and the same discipline applies with any tool.
Key takeaways
- hreflang tells Google which pages are language or regional alternates of each other; it does not translate or boost rankings.
- Use ISO 639-1 language codes, optionally with an ISO 3166-1 Alpha 2 region; a region alone is invalid.
- Every version must link to itself and to every other version, and each pair must link back or the annotations are ignored.
- Use fully-qualified URLs, and match them exactly to each page's canonical URL.
x-defaultis an optional fallback, designed for language selector pages.- Bing's handling of hreflang is not documented as precisely as Google's, so verify before assuming identical behaviour.
Sources
- Localized versions of your pages – Google Search Central – hreflang methods, syntax, return links, x-default, language and region codes
- Managing multi-regional and multilingual sites – Google Search Central – how Google determines page language, URL structures
- Does Duplicate Content Hurt SEO and AI Search Visibility? – Bing Webmaster Blog – Bing's recommendation to use hreflang for language and regional targeting
- How To Tell Bing Your Website's Country and Language – Bing Webmaster Blog (2011) – legacy content-language guidance
Frequently asked questions
Does hreflang improve my rankings?
Google describes hreflang as a way to tell it which localized version of a page exists for which language or region, so the right version can be shown to the right user. It is not documented as a ranking boost. Its job is to help match audience and page, not to lift a page above competitors.
Do I need hreflang if my site is only in one language?
No. hreflang describes relationships between alternate versions of a page. If a page has no translated or regional variants, there is nothing to annotate. Add it when you publish a second version, such as a French or Canadian English page.
What happens if I forget the return links?
Google states that if two pages do not both point to each other, the annotations are ignored. Every version must list every other version and itself. A missing link on one page can therefore invalidate the pairing, even if the other page is correct.
Can I use hreflang across different domains?
Yes. Google's documentation says alternate URLs can be on different domains, so example.com and example.fr can reference each other. The same rules apply: fully-qualified URLs, a link to every version including the page itself, and return links from each version.