Skip to content

What Is Hreflang? A Plain-English Guide With Examples

Hreflang is an annotation that tells Google which language, and optionally which country, each version of a page is written for, so searchers in each market see the version meant for them.

By Kristijan GjorgjioskiIndependent SEO consultant

Published 18 October 2026 · 7 min read

Key takeaways

  • Hreflang links equivalent pages in different languages or regions, so Google can show a French searcher the French page instead of the English one.
  • Every version must list itself and all the others. Google says that if two pages don't both point to each other, the tags will be ignored.
  • Codes use an ISO 639-1 language, optionally followed by an ISO 3166-1 Alpha 2 region. The United Kingdom is en-gb, never en-uk.
  • Google treats the HTML head, HTTP header and XML sitemap methods as equivalent. Pick one and keep it accurate.

You've translated your site, launched in a new country and waited.

And Google keeps showing your UK page to searchers in Ireland, or your English page to people searching in Spanish.

That's usually a hreflang problem.

In this guide, you'll learn what hreflang is, how it works, which codes are valid and the mistakes I find most often when I review international SEO setups.

What Is Hreflang?

Hreflang is an HTML attribute, also usable in HTTP headers and sitemaps, that tells search engines which language and region a page targets and which other URLs are its equivalent versions.

Here's a simple example.

Say you sell in the UK and the US. You have two near-identical English pages, with different prices, spelling and delivery details:

Without hreflang, Google sees two very similar pages and has to guess which one to show where.

With hreflang, both pages carry the same pair of annotations in their head section:

<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/pricing/" />
<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/pricing/" />

Now Google knows the first is for English speakers in Britain and the second for English speakers in the United States.

What Hreflang Is NOT

You'll often see hreflang confused with other things. It isn't any of these:

  • A language detector. Google says it doesn't use hreflang or the html lang attribute to work out a page's language. It reads the visible content.
  • A ranking boost. It helps Google choose which version to show, rather than pushing any page higher.
  • A redirect. Nobody gets moved anywhere. Searchers simply see a different URL in results.
  • A canonical tag. Canonicals pick one preferred URL among duplicates. Hreflang connects alternates that should all stay indexed.

Why Does Hreflang Matter?

Because the wrong page in the wrong market costs you sales.

A searcher in Dublin who lands on your UK page sees sterling prices and UK delivery terms. Someone in Mexico who lands on your Spain page sees the wrong vocabulary and shipping options.

Most of them leave.

You need hreflang most in three situations:

  • Same language, several countries. UK, US and Australian English, or Spanish for Spain and Mexico. These versions look like duplicates without hreflang.
  • Different languages of the same page. A German and a French version of one product page.
  • A global fallback. A country selector or international page for everyone you don't target directly.

In my experience, broken hreflang rarely throws an obvious error. Each market just underperforms quietly, and nobody connects it to a few lines of code.

How Does Hreflang Work?

Hreflang works in clusters. A cluster is every version of one page, across all its languages and regions.

Google's documentation on localised versions of pages sets out the core rules:

  • Each version lists itself and all the others. The set of annotations is identical on every page in the cluster.
  • Links must go both ways. If two pages don't both point to each other, Google says the tags will be ignored.
  • URLs must be fully qualified. Use https://example.com/de/, not /de/ or //example.com/de/.
  • Versions can sit on different domains. example.de and example.fr can belong to one cluster.

That two-way rule is what trips most sites up.

Add a new language to five existing pages but forget to update the old ones, and the new annotations can be ignored.

The fix is to generate every annotation from one source of truth, such as a spreadsheet or your CMS, rather than typing them by hand.

My free hreflang generator takes your list of versions and builds the full reciprocal set of tags, plus matching XML sitemap entries, so every version references every other.

What Do Hreflang Codes Look Like?

A hreflang value is a language code, optionally followed by a region code.

According to Google, only ISO 639-1 language codes and ISO 3166-1 Alpha 2 region codes are supported. Here's how that plays out:

Value Valid? Meaning
de Yes German, any country
de-at Yes German for Austria
en-gb Yes English for the United Kingdom
en-uk No UK is a reserved code, so it has no effect
be Careful Valid, but it means Belarusian, not Belgium
zh-Hant Yes Chinese in Traditional script

A few rules worth remembering:

  • A region can't stand alone. You can target a language without a country, but never a country without a language.
  • Case doesn't matter. Google says the value is case-insensitive.
  • Scripts are allowed. You can add an ISO 15924 script code, such as zh-Hans or zh-Hant.

What Is x-default?

x-default is a reserved hreflang value for visitors whose language and location match none of your listed versions.

Google describes it as a fallback. It often points to a language selector page or your main international version.

<link rel="alternate" hreflang="x-default" href="https://example.com/" />

You don't strictly need it. But on any site with more than a couple of markets, I add it, so searchers from countries you don't target still land somewhere sensible.

Three Ways to Add Hreflang

Google supports three methods and says they're equivalent from its point of view:

Method Where it goes Best for
HTML link tags In the head of each page Small and medium sites with editable templates
HTTP headers In the server response PDFs and other non-HTML files
XML sitemap In xhtml:link entries per URL Large sites, or platforms with locked templates

Use one method, not all three.

Google says doubling up gives no extra benefit, and it gives you two or three places to keep in sync. When they disagree, you've created the problem you were trying to solve.

For HTML tags, they must sit inside a well-formed head section. If a script or a stray element breaks the head early, the tags below it can be missed.

Common Hreflang Mistakes

These are the problems I run into most often:

  • One-way annotations. Page A lists page B, but page B never lists page A.
  • Invented codes. en-uk, en-eu or a country code on its own.
  • Relative URLs. Google needs the full address, protocol included.
  • Targets that aren't final. Pointing hreflang at URLs that redirect, carry noindex or canonicalise elsewhere sends mixed signals, so I only ever list the live, indexable, self-canonical version.
  • Every language canonicalised to English. That tells Google the other versions are duplicates of one page.
  • Forced redirects by location. Google advises against automatically redirecting users between language versions, since it can stop crawlers reaching them.

That last one deserves a closer look.

Google's guide to multi-regional and multilingual sites notes that Googlebot usually crawls from the USA without an Accept-Language header. Redirect by IP or browser language, and some versions may never be seen.

A banner that suggests the local version is the safer choice.

Moving URLs is another moment hreflang breaks. If you're restructuring, update the annotations alongside your redirect map, or every cluster points at redirects on launch day.

That's one reason I treat a change of markets or languages as a full site migration, not a quick template edit.

How to Check Your Hreflang Setup

Checking hreflang is mostly about crawling, because your errors can hide across hundreds of pages.

Here's my routine:

  • Crawl the site with a tool that reports hreflang, such as Screaming Frog or Sitebulb.
  • Look for missing return links, invalid codes and targets that don't return 200.
  • Spot-check a few clusters by viewing the page source.
  • In Search Console, compare clicks by country with the pages that receive them.

That last check is the real test. If your UK pages collect most of the clicks from Australia, your setup isn't working, whatever the crawler says.

Hreflang also belongs on any technical SEO checklist you run after a release, and a full SEO audit checks it alongside everything else.

Your choice of structure affects all of this too. My comparison of ccTLD vs subfolder vs subdomain covers which setup suits which business.

For a real example of a site published in two languages, see this bilingual pet transport case study. And remember that translated keywords are rarely the ones locals search, which is why per-market keyword research matters as much as the tags.

Get Each Market's Page in Front of the Right Searchers

Hreflang is a small piece of code with a big job: matching every searcher to the version built for them.

Start with one cluster. Pick your most valuable page, list every language version, and check each one references all the others, itself included.

If that one cluster is clean, roll the same source of truth across the site.

Bigger issues such as rendering or crawl problems fall under technical SEO. And if you want the structure, hreflang and market research handled together, here's how my international SEO consulting works.

Frequently asked questions

Does hreflang improve rankings?

Not directly. Hreflang does not make a page rank higher. It helps Google pick which equivalent version of a page to show a searcher based on their language and location. The benefit is indirect: the right page reaches the right market, so fewer visitors land on the wrong prices, spelling or delivery terms and leave straight away.

Do I need hreflang if my site is in one language?

Only if you target several countries with that language. A site with separate UK, US and Australian English pages benefits from hreflang because the versions look nearly identical. A single-language site aimed at one country does not need it at all, and adding it to a one-version site does nothing.

What is the difference between hreflang and the html lang attribute?

The html lang attribute declares the language of the page it sits on, which browsers, translation tools and screen readers use. Hreflang points to the other language or country versions of that page. Google says it uses neither to detect a page's language, relying on the visible content instead, but it does use hreflang to choose which version to show.

Is hreflang case-sensitive?

No. Google's documentation says the hreflang value is case-insensitive, so en-GB, en-gb and EN-GB all work. Most developers use a lowercase language and an uppercase region, such as en-GB, because that matches the usual convention and is easier to read, but Google treats them the same.

About the author

Kristijan Gjorgjioski

Independent SEO consultant · 6+ years in SEO · 60+ client websites worked on

I'm an independent SEO consultant with 6+ years in SEO. I run audits, migrations and content programmes for businesses in Europe, the UK and the USA, and I build the automation behind my own research.

Need help with international seo?

Book a free 30-minute call. I look at your site first and tell you plainly what I would fix, and in what order.