By GrowthSyntax Editorial · Updated July 2026 · 9 min read

What is hreflang and how to use it? Hreflang is an HTML attribute that tells search engines which language and country a page is meant for. You add it as a link tag in the page head, pointing to every language or regional version of that same content. Google then serves the correct version to each searcher automatically.
rel=”alternate”
Core HTML attribute used in every hreflang tag
x-default
Special value used for a fallback page with no specific region
Free
Cost to build correct hreflang tags with an online generatorTable of Contents
- What Is Hreflang?
- Why Hreflang Matters for International SEO
- Hreflang Syntax Explained
- What Is Hreflang and How to Use It Correctly
- A Working Hreflang Example
- Three Ways to Implement Hreflang
- Common Hreflang Mistakes to Avoid
- Hreflang vs Canonical Tags
- How to Test Your Hreflang Tags
- Frequently Asked Questions
What Is Hreflang?
Hreflang is an HTML attribute that signals language and regional targeting to search engines. It lives inside a link tag in your page’s head section. Search engines read it to decide which version of a page to show a searcher.
Google introduced hreflang to solve a specific problem. Sites with the same content in multiple languages often confused search engines about which page to rank. The same issue applied to one language used across different countries. Hreflang removes that guesswork.
Without hreflang, search engines might show a French visitor your English page. A Canadian visitor might land on your UK pricing page instead. Neither outcome helps conversions. Hreflang fixes this by matching content to the right audience automatically.
Why Hreflang Matters for International SEO
Duplicate content across regions creates a real ranking risk without hreflang in place. Search engines may struggle to pick which version deserves to rank, splitting authority between pages. Hreflang groups these pages together instead of treating them as competitors.
User experience improves directly too. A visitor from Germany reading a German-language page converts far better than one stuck reading English. Hreflang routes each visitor to their best match.
Hreflang does not translate content for you. It only tells search engines which already-translated page matches which audience. You still need a properly localized version of each page for hreflang to work well.
Crawl budget benefits from hreflang as well, especially on larger sites. Search engines spend less effort deciding which near-duplicate page to rank once the relationships are clearly defined. That saved effort often goes toward crawling new or updated pages instead.

Hreflang Syntax Explained
A single hreflang tag has three main parts. Each part plays a specific role in telling search engines exactly which page matches which audience.
| Part | What It Does | Example |
| rel=”alternate” | Marks this as an alternate version of the page | rel=”alternate” |
| hreflang=”en-us” | Names the language and optional region code | hreflang=”en-us” |
| href=”url” | Points to the exact URL of that version | href=”https://site.com/us/” |
Language codes follow the ISO 639-1 standard, like “en” for English or “fr” for French. Region codes follow ISO 3166-1, like “US” for the United States or “CA” for Canada. Combine them with a hyphen, such as “en-gb” for British English.
What Is Hreflang and How to Use It Correctly
Understanding what hreflang is only solves half the problem. Knowing how to use it correctly across every page matters just as much. A few core rules keep the setup working as intended.
Every page in a language group must link to every other page in that group, including itself. People call this a return link, and missing ones are the single most common hreflang error. Search engines may ignore the entire group if return links are incomplete.
Add one hreflang tag for every language and regional variant. Include one “x-default” tag too, for visitors who match no specific rule. The x-default page usually shows a language selector or your primary market’s version.
A Working Hreflang Example
Seeing complete code helps more than reading rules alone. Here is a realistic set of tags for a site with English, French, and a default page.
<link rel=”alternate” hreflang=”en-us” href=”https://example.com/us/” />
<link rel=”alternate” hreflang=”fr-fr” href=”https://example.com/fr/” />
<link rel=”alternate” hreflang=”x-default” href=”https://example.com/” />
Each of these three lines needs to appear on all three pages, not only on one. The homepage, the US page, and the French page all carry the identical set of tags. That repetition creates the return links search engines require.
Missing this step is the most frequent reason hreflang setups fail in practice. A single page listing tags without matching return links rarely gets treated as valid. Consistency across every page in the group matters more than the tags on any single page.
Three Ways to Implement Hreflang
HTML link tags are the most common method, placed directly in the head section of each page. This approach works well for smaller sites with a manageable number of language versions.
HTTP headers offer a second method, useful for non-HTML files like PDFs. The server sends hreflang information in the response header instead of inside the page code itself.
Sitemap entries provide a third method, often the easiest for large sites. Instead of editing every page, you list all language relationships inside your XML sitemap in one central place.
Pick one method and stick with it. Mixing HTML tags and sitemap entries for the same pages can create conflicting signals. Choose the method that fits your site size and stay consistent.
| Method | Best For | Main Drawback |
| HTML link tags | Small to medium sites with a manageable page count | Adds tags to every page individually |
| HTTP headers | Non-HTML files, like PDFs or documents | Requires server configuration access |
| XML sitemap entries | Large sites with many language pairs | Sitemap file grows large and complex |
Common Hreflang Mistakes to Avoid
Incorrect language or region codes cause more failures than any other single error. Writing “uk” instead of the correct “gb” for Great Britain is a classic example. Always double-check codes against the official ISO lists.
Missing return links come in a close second. If page A links to page B, page B must link back to page A. Search engines discard the whole relationship when this link fails to close the loop.
Blocking regional pages in robots.txt causes a fourth common failure. Crawlers cannot read hreflang tags on a page they are not allowed to visit. Always confirm every regional URL stays crawlable before adding it to a hreflang group.
Pointing hreflang tags at a non-canonical URL also breaks the setup. Each hreflang entry should point to the canonical version of that regional page, never to a redirect or duplicate.
Hreflang vs Canonical Tags
Canonical tags and hreflang tags often confuse people new to technical SEO. A canonical tag tells search engines which URL is the master copy among near-duplicate pages on the same site. Hreflang tells search engines which page serves which language or region.
These two tags work together rather than replacing each other. Each regional page should carry a self-referencing canonical tag, pointing to itself, alongside its full set of hreflang tags. Pointing a canonical tag at a different language version by mistake can cancel out your hreflang setup entirely.
Keep the two concepts separate in your mind while building tags. Canonical answers “which URL matters within this one page’s duplicates.” Hreflang answers “which URL matters for this one visitor’s language and region.”
How to Test Your Hreflang Tags
Never assume hreflang works correctly just because you added the tags. A single typo can silently break the entire setup. Testing takes only a few minutes and catches most common errors.
Google Search Console offers an International Targeting report that flags many hreflang issues automatically. Check it regularly, especially after adding a new language or region to your site.
Viewing your page source directly also works well for a quick manual check. Search for “hreflang” in the raw HTML and confirm every expected language and region appears with the correct URL.
🌐 Build Your Hreflang Tags Free Skip the manual syntax and use the Hreflang Tag Generator to create correctly formatted tags for every language and region in seconds.
Pairing Hreflang With Open Graph Locale Tags
Hreflang controls how search engines crawl and rank regional pages. Social platforms read a different signal entirely, called the og:locale tag, when displaying link previews. Both matter for a fully localized presence online.
A free Open Graph & Social Tag Generator builds the correct og:locale value alongside your other social tags. Pairing it with hreflang covers both search results and social share previews for every regional version of your site.
Frequently Asked Questions
What is hreflang and how to use it on a small website?
Add simple link tags in your page head for each language version you offer. Even two or three languages benefit from correct hreflang tags.
Does hreflang affect my page’s ranking directly?
Not directly. It affects which version of your page ranks in each region, rather than boosting or lowering rankings overall.
Can I use hreflang without translating my content?
Technically yes, for regional variants of the same language. For different languages, hreflang works best paired with real translated content.
Is x-default required on every hreflang setup?
It is optional but strongly recommended. Search engines get a clear fallback page for visitors who match no specific rule.
How many hreflang tags can one page have?
As many as needed, one for every language and region version, plus the site itself. Large international sites often use dozens.
Will Google ignore my hreflang tags if I make small errors?
Often, yes. Google tends to ignore inconsistent or broken hreflang relationships rather than guessing at the intended structure.
Do hreflang and canonical tags conflict with each other?
They should not, if set up correctly. Each page needs a self-referencing canonical tag alongside its full hreflang set.
Final Word: Using Hreflang the Simple Way
Now you understand what hreflang is and how to use it across a multilingual or multi-regional site. The syntax stays simple, even when the number of language pairs grows large.
Focus on return links and correct language codes first, since these two areas cause most real-world failures. Test your setup in Search Console after every major update to your site structure.
The Hreflang Tag Generator above builds correctly formatted tags for every region in seconds, no manual syntax required.