What is hreflang? How to show Google the right language version

Short answer: hreflang is a code that tells Google a page exists in several language or country versions, and which version belongs to which audience. Google can then show the British page to someone searching in the UK and the American page to someone in the US, or the Swedish page to a Swedish searcher. Each version must point to itself and to every other version, or the tags are ignored.
Who needs hreflang?
You need hreflang if the same content exists in several languages, such as English and Swedish versions of your service pages, or if you have versions for different countries in the same language, such as British and American English. If your site only has one language, you do not need it.
Without hreflang, Google may show the wrong version, for example the American page with dollar prices to a British searcher, or treat the versions as competing duplicates.
How to write hreflang
There are three equivalent methods (Google Search Central):
- Link tags in the page head. The most common for ordinary web pages.
- HTTP headers. Used for non-HTML files such as PDFs.
- The sitemap. Practical for large sites, because the code does not need to sit on every page.
This is what the link tags look like for a page in British English and Swedish:
<link rel="alternate" hreflang="en-GB" href="https://example.co.uk/services" />
<link rel="alternate" hreflang="sv" href="https://example.co.uk/sv/tjanster" />
<link rel="alternate" hreflang="x-default" href="https://example.co.uk/services" /> The same three lines must appear on both the English and the Swedish page.
The rules that must be right
- Every version lists itself and all the others. If the English page points to the Swedish one, the Swedish page must point back (Google Search Central).
- Full URLs with https://, not relative paths.
- Correct codes. First the language in ISO 639-1, then optionally the country in ISO 3166-1, such as en, en-GB or sv-FI. A country without a language is invalid, and the United Kingdom is GB, not UK (Google Search Central).
- x-default sets which version shows when no other matches the searcher's language (Google Search Central).
- Only point to pages that work and are canonical, not to redirects or error pages.
One important detail: Google does not use hreflang or the lang attribute to work out what language a page is written in. It does that from the visible content (Google Search Central). Hreflang only helps Google choose the right version. Bing, which handles about 6 percent of UK searches (StatCounter), is said to rely mainly on the content-language tag, so it can be worth adding (Search Engine Roundtable).
English: en, en-GB or en-US?
- One English version for everyone: use en. It covers all English speakers regardless of country.
- Separate British and American versions, for example with prices in pounds and dollars or different spelling: use en-GB and en-US, and consider en as the fallback for other English speakers.
- Never write en-UK. It is invalid, and Google ignores it.
A UK version should also look British: pounds, UK spelling, UK contact details and VAT. Hreflang points Google to the right page, but the content is what convinces the visitor.
How we do it on our own site
Our website exists in several languages, so we have had to solve this ourselves:
- Blog posts that exist in English, Swedish and Norwegian, like this one, are separate posts with their own URLs and their own keywords for each market. They point to each other with hreflang.
- Posts that only exist in one language list only that language. Pointing to a page that does not exist is one of the most common mistakes.
- The sitemap lists the language versions for blog posts, so Google gets the information from there too.
- The URLs are translated. The Swedish version of this article is /sv/blogg/vad-ar-hreflang and the Norwegian one /no/blogg/hreflang.
Everything is generated automatically from the same data that controls which pages exist in which language. That means the tags cannot be forgotten when a page or language is added.
The most common mistakes
Ahrefs studied nearly 375,000 domains with hreflang and found that 67 percent had at least one error (Ahrefs):
| Error | Share of domains |
|---|---|
| Missing x-default | 56.3% |
| Page does not reference itself | 18% |
| Points to broken or redirected pages | 16.9% |
| Missing return links | 15.3% |
| Points to non-canonical pages | 8% |
| Invalid language or country codes | 4.6% |
Another common mistake is automatically redirecting visitors to another language version based on browser settings. Google advises against it, because both visitors and Google may struggle to reach all versions (Google Search Central). Show a clear language switcher instead.
URL structures for several languages
Google describes four ways to structure a multilingual site (Google Search Central):
| Structure | Example | Comment |
|---|---|---|
| Country domain | example.co.uk | Clearest for one country, but more domains to manage |
| Subdomain | uk.example.com | Easy to separate technically |
| Subfolder | example.com/en-gb/ | Easiest to manage, one domain gathers all authority |
| Parameter | example.com?lang=en | Not recommended by Google |
Also keep one language per page, both in content and navigation, rather than translations side by side (Google Search Central). The basics of how Google finds and chooses pages are in What is SEO? and Google indexing.
Frequently asked questions
What is hreflang?
Hreflang is a code that tells Google a page exists in several language or country versions, and which version belongs to which audience. Google can then show the right version to the right searcher.
Do I need hreflang?
Yes, if the same content exists in several languages or you have versions for different countries in the same language, such as British and American English. A single-language site does not need it.
What is x-default?
x-default is a reserved hreflang value that sets which version to show when none of the other language versions matches the searcher's language.
What is the hreflang code for the UK?
en-GB. The country code for the United Kingdom is GB, not UK, so en-UK is invalid and ignored by Google. Use en on its own for one English version for all countries.
Why are my hreflang tags not working?
The most common reasons are that pages do not point back to each other, a page does not reference itself, x-default is missing, tags point to redirected or broken pages, or the language codes are invalid.
Sources
- Tell Google about localized versions of your page, Google Search Central
- Managing multi-regional and multilingual sites, Google Search Central
- Hreflang study, Ahrefs
- Bing on the content-language meta tag, Search Engine Roundtable
- Search engine market share United Kingdom, StatCounter








