If your site has versions of the same page for different languages or countries, hreflang tells Google which version to show to which searcher. Without it, a UK visitor might land on your US page, or a Spanish speaker on the English one. Create correct tags for each version with the hreflang tag generator.

Quick answer: Hreflang is an annotation that lists all language and regional versions of a page. Each version must list every version including itself, and links must be reciprocal: if page A points to page B, B must point back to A. Use language codes such as en or ar, optionally with a region, such as en-GB or ar-AE; a country code alone is invalid. Add an x-default for visitors whose language isn't matched. You can put hreflang in the HTML head, in HTTP headers or in your sitemap. It changes which URL is shown, not how high it ranks.

When you need hreflang

You don't need it for a single-language site aimed at one country.

Codes

Value Meaning
en English speakers anywhere
en-GB English speakers in the United Kingdom
en-AE English speakers in the United Arab Emirates
ar Arabic speakers anywhere
zh-Hant Chinese in traditional script
x-default Fallback for unmatched languages or regions

Languages use ISO 639-1 codes and regions use ISO 3166-1 alpha-2. The UK is GB, not UK.

An example

Each of the three pages below would include all three lines plus x-default in its head:

Three ways to add it

Method Best for
HTML link tags in the head Most sites with a manageable number of versions
HTTP headers Non-HTML files such as PDFs
XML sitemap Large sites with many versions, to keep page code light

Pick one method per page to avoid conflicting signals. Build sitemaps with the XML sitemap generator.

Hreflang and canonicals

Each language version should have a self-referencing canonical. Don't canonicalise all versions to one language, or Google may ignore the alternates. See canonical tags explained.

Common mistakes

Check each URL returns 200 with the HTTP status code checker. More tools are in the SEO tools guide.

Based on Google Search Central documentation as at November 2026.

Frequently asked questions

What is hreflang?

An annotation that tells Google about language and regional versions of a page so it can show the right one to each searcher.

Does hreflang improve rankings?

No. It helps Google show the most suitable version of a page, not rank it higher.

What is x-default in hreflang?

A fallback version for visitors whose language or region doesn’t match any listed version, often a language selector page.

Is hreflang=uk correct for the United Kingdom?

No. Use en-GB. Region codes must follow a language code, and the UK’s code is GB.

Do hreflang tags need to be reciprocal?

Yes. Every version must link to every other version and to itself, or Google may ignore the annotations.

Should I use hreflang in HTML or a sitemap?

Either works. HTML suits smaller sites; sitemaps suit large sites with many versions. Use one method consistently.

Sources

Last updated: