Hreflang tags are HTML link elements that help search engines understand the language and regional variations of a webpage. They are an important component of international SEO, helping businesses connect users with the most relevant version of their content based on language and geographic location.
For businesses operating across multiple countries or languages, delivering the right content to the right audience is fundamental to organic search performance. A website may have different versions of the same page for customers in the United Kingdom, United States, Australia, France or Germany, each reflecting local terminology, currencies, products and consumer expectations.
Hreflang provides search engines with a structured way to understand the relationship between these pages, supporting international discoverability and more relevant user experiences.
What are hreflang tags?
Hreflang is an HTML attribute used to specify the language and optional geographic region of a webpage. It communicates to search engines that multiple URLs represent alternative language or regional versions of the same or equivalent content.
A hreflang annotation typically contains three components:
- rel="alternate": Identifies the URL as an alternative version of the content.
- hreflang: Specifies the intended language and, where applicable, geographic region.
- href: Provides the URL of the alternative webpage.
A standard hreflang tag for a webpage targeting English-speaking users in the United Kingdom would look like this:
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
In this example, the language code en represents English, while the region code GB represents the United Kingdom.
How do hreflang tags work?
Hreflang tags establish relationships between equivalent webpages that target different languages or geographic markets.
When Google discovers these annotations, it can use the information to help determine which version of a webpage is most relevant to a particular user's search.
For example, an international ecommerce business may operate separate versions of its website for the United Kingdom, United States and Australia. Each version may contain similar products but use different currencies, spelling conventions, delivery information and regional pricing.
The corresponding hreflang implementation could look like this:
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="en-AU" href="https://www.example.com/au/" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />
Each annotation identifies a specific version of the content and its intended audience. Google can use these relationships to help surface the appropriate regional URL within its search results.
Hreflang functions as a signal within Google's wider search systems. The version displayed may also depend on the user's query, language preferences, location and other relevance signals.
What is the difference between multilingual and multiregional hreflang?
Hreflang supports websites that operate across multiple languages, multiple geographic regions or a combination of both.
Multilingual websites
A multilingual website provides content in more than one language. Hreflang can help search engines understand which URL corresponds to each language.
<link rel="alternate" hreflang="en" href="https://www.example.com/en/" />
<link rel="alternate" hreflang="fr" href="https://www.example.com/fr/" />
<link rel="alternate" hreflang="de" href="https://www.example.com/de/" />
These annotations identify English, French and German language versions of the content, irrespective of a specific country.
Multiregional websites
A multiregional website provides content tailored to audiences in different geographic markets. These markets may share the same language while having different commercial requirements and consumer expectations.
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="en-CA" href="https://www.example.com/ca/" />
These annotations allow a business to distinguish between English-language content intended for audiences in the United Kingdom, United States and Canada.
Multilingual and multiregional websites
International businesses may also provide multiple languages within individual geographic markets.
For example, a business operating in Canada may provide separate English and French language experiences, alongside additional versions for audiences in the United Kingdom, United States and France.
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="en-CA" href="https://www.example.com/ca-en/" />
<link rel="alternate" hreflang="fr-CA" href="https://www.example.com/ca-fr/" />
<link rel="alternate" hreflang="fr-FR" href="https://www.example.com/fr/" />
This approach supports more precise international targeting by communicating both language and regional relationships between webpages.
Understanding hreflang language and country codes
Hreflang annotations use standardised language and region codes to identify their intended audiences.
Google supports language codes based on ISO 639-1 and optional region codes based on ISO 3166-1 Alpha-2. Language codes are conventionally written in lowercase, with region codes written in uppercase.
| Hreflang code | Language | Target market |
|---|---|---|
en |
English | English-speaking audiences globally |
en-GB |
English | United Kingdom |
en-US |
English | United States |
en-AU |
English | Australia |
en-CA |
English | Canada |
en-IE |
English | Ireland |
fr |
French | French-speaking audiences globally |
fr-FR |
French | France |
fr-CA |
French | Canada |
de-DE |
German | Germany |
de-AT |
German | Austria |
de-CH |
German | Switzerland |
es-ES |
Spanish | Spain |
es-MX |
Spanish | Mexico |
it-IT |
Italian | Italy |
pt-PT |
Portuguese | Portugal |
pt-BR |
Portuguese | Brazil |
nl-NL |
Dutch | Netherlands |
ja-JP |
Japanese | Japan |
zh-CN |
Chinese | China |
What is x-default in hreflang?
The x-default hreflang value identifies a fallback version of a webpage for audiences whose language or regional preferences fall outside the explicitly defined alternatives.
It is particularly useful for international businesses that operate a global homepage, country selection page, language selector or internationally accessible version of their website.
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/" />
<link rel="alternate" hreflang="fr-FR" href="https://www.example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />
In this example, the global homepage acts as the fallback destination for audiences outside the specified language and regional combinations.
Using x-default is optional and can provide additional clarity within an international website architecture, particularly where businesses serve customers across a wide range of markets.
What are the different ways to implement hreflang tags?
Search Engines supports three methods of hreflang implementation: HTML link elements, HTTP response headers and XML sitemaps.
Each method communicates the same language and regional relationships. The most suitable approach depends on the website's architecture, content management system, development capabilities and scale.
| Method | Implementation location | Typical application |
|---|---|---|
| HTML link elements | HTML head section | Websites with template-based page management |
| HTTP response headers | Server response | PDFs, downloadable documents and other non-HTML resources |
| XML sitemaps | XML sitemap files | Large international websites and ecommerce platforms |
HTML hreflang tags
HTML implementation places hreflang link elements within the <head> section of each relevant webpage.
Each page should reference its own language or regional version alongside the corresponding alternative versions.
This method integrates well with content management systems and website templates, allowing hreflang annotations to be generated dynamically based on page relationships.
<head>
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/product/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/product/" />
<link rel="alternate" hreflang="fr-FR" href="https://www.example.com/fr/produit/" />
</head>
HTTP header hreflang implementation
Hreflang annotations can also be included within HTTP response headers. This provides an effective implementation method for resources such as PDF documents that operate outside a standard HTML page structure.
Link: <https://www.example.com/uk/brochure.pdf>; rel="alternate"; hreflang="en-GB", <https://www.example.com/fr/brochure.pdf>; rel="alternate"; hreflang="fr-FR"
Each corresponding resource should return the relevant set of language and regional annotations within its response headers.
XML sitemap hreflang implementation
XML sitemaps provide a centralised method of communicating language and regional relationships between URLs.
This approach can be particularly useful for enterprise websites, international ecommerce businesses and platforms managing extensive product catalogues across multiple markets.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://www.example.com/uk/product/</loc>
<xhtml:link rel="alternate" hreflang="en-GB"
href="https://www.example.com/uk/product/" />
<xhtml:link rel="alternate" hreflang="en-US"
href="https://www.example.com/us/product/" />
</url>
<url>
<loc>https://www.example.com/us/product/</loc>
<xhtml:link rel="alternate" hreflang="en-GB"
href="https://www.example.com/uk/product/" />
<xhtml:link rel="alternate" hreflang="en-US"
href="https://www.example.com/us/product/" />
</url>
</urlset>
Each URL entry contains the associated alternative URLs, including its own language or regional version.
What is the difference between hreflang and canonical tags?
Hreflang and canonical tags serve complementary purposes within technical SEO.
A canonical tag identifies the preferred URL among duplicate or substantially similar webpages. Hreflang identifies alternative language and regional versions of equivalent content.
| Consideration | Hreflang | Canonical |
|---|---|---|
| Primary purpose | Identify language and regional alternatives | Identify the preferred version of a URL |
| HTML relationship | rel="alternate" |
rel="canonical" |
| Typical application | Multilingual and multiregional websites | Duplicate and substantially similar content |
| Number of references | Multiple language and regional alternatives | One preferred canonical URL per page |
| SEO contribution | Language and regional search relevance | URL consolidation and canonical selection |
Where each regional page is intended to be independently indexed, a common implementation combines a self-referencing canonical tag with hreflang annotations for all corresponding alternatives.
For example, a UK webpage may contain:
<link rel="canonical" href="https://www.example.com/uk/product/" />
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/product/" />
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/product/" />
<link rel="alternate" hreflang="fr-FR" href="https://www.example.com/fr/produit/" />
The canonical tag establishes the preferred URL for the UK version, while the hreflang annotations communicate its relationship with the US and French versions.
Why are hreflang tags important for SEO?
Hreflang contributes to international search performance by helping search engines understand which versions of a website are intended for particular audiences.
Its value extends across technical SEO, international visibility, user experience and commercial performance.
Improved regional search relevance
Hreflang helps search engines identify the most appropriate language and regional versions of content, supporting the visibility of locally relevant webpages within international search results.
More relevant user experiences
Connecting users with the appropriate regional content helps ensure they encounter relevant currencies, product information, terminology, delivery options and commercial propositions.
Stronger international website architecture
Hreflang establishes structured relationships between equivalent pages, helping businesses manage increasingly complex international websites and content ecosystems.
Clearer relationships between regional content
International businesses frequently publish similar content across different English-speaking or shared-language markets. Hreflang helps communicate the intended regional relationship between these pages.
Support for international conversion performance
Delivering locally relevant content can create a stronger connection between consumer expectations and the website experience. Regional pricing, language, availability and delivery information can all contribute to purchasing confidence and conversion performance.
International SEO connects global visibility with local relevance. Hreflang helps ensure that the content audiences discover reflects the market in which they live, search and purchase.
How does hreflang work across different website structures?
International websites can use several URL structures to organise language and regional content. Hreflang supports each of the principal approaches, giving businesses flexibility in how they establish their international digital presence.
| Website structure | Example | Typical consideration |
|---|---|---|
| Country-code domains (ccTLDs) | example.co.uk example.fr example.de |
Distinct country-specific websites and geographic signals |
| Subdomains | uk.example.com fr.example.com de.example.com |
Separate regional environments within a shared domain |
| Subdirectories | example.com/uk/ example.com/fr/ example.com/de/ |
Centralised website management across international markets |
Hreflang annotations can reference URLs across different domains, subdomains and subdirectories, provided the corresponding pages establish valid reciprocal relationships.
The choice of international website architecture should reflect the business's commercial strategy, technical infrastructure, content management requirements and long-term market ambitions.
Hreflang frequently asked questions
Can hreflang tags be used across different domains?
Yes. Hreflang annotations can establish relationships between alternative webpages hosted on separate domains, subdomains or subdirectories. Cross-domain implementations should maintain consistent reciprocal relationships between corresponding URLs.
What is the correct hreflang tag for the UK?
The correct hreflang value for English-language content targeting the United Kingdom is en-GB. The language code identifies English, while the regional code identifies the United Kingdom.
Can you use hreflang without a country code?
Yes. A language-only hreflang value such as en, fr or de identifies content intended for speakers of that language across geographic markets. Regional codes can be added where more specific country targeting is appropriate.
Can a URL have multiple hreflang values?
Yes. A single URL can be assigned multiple hreflang values where the same content is appropriate for several language and regional audiences. Each value should be communicated through a separate hreflang annotation.
Is hreflang the same as the HTML lang attribute?
Hreflang identifies language and regional relationships between alternative URLs. The HTML lang attribute declares the language of the current document, supporting browsers, assistive technologies and accessibility. Both attributes serve complementary purposes within website development