Hreflang Tag Generator

Generate correct hreflang <link> tags for multilingual and multiregional websites. Add all language/region URL variants and copy the output.


URL Variants

Add each language/region version of this page with its corresponding hreflang code.



Common Hreflang Codes
en en-US en-GB en-AU fr fr-FR fr-CA de de-DE es es-ES es-MX it pt pt-BR pt-PT nl sv da fi no pl ru zh zh-CN zh-TW ja ko ar tr x-default
Generated Hreflang Tags

            

Frequently Asked Questions

Hreflang tags tell Google which language and geographic region a page is intended for, and how different URL variants relate to each other. Google uses them to serve the correct language version of a page to users in different countries and to consolidate duplicate content signals for international sites.

hreflang="x-default" signals the fallback URL to use when no other language/region variant matches the user's settings. This is typically your main homepage or a language selection page. Google recommends including it whenever you implement hreflang.

Yes. Hreflang annotations must be reciprocal — every page in the set must reference all other pages, including itself. If page A references page B, then page B must also reference page A. Missing reciprocal links will cause Google to ignore the hreflang annotations entirely.

Yes. You can implement hreflang three ways: in the HTML <head>, in HTTP response headers (for non-HTML files), or in your XML sitemap. The sitemap approach is the easiest for large sites with many language versions as it centralizes all annotations in one file.

hreflang="x-default" designates the fallback URL for users whose language and region do not match any of the specified hreflang variants. It is typically set to a global homepage, an international landing page, or a language selector page. Google uses x-default to determine where to send users from countries and languages not explicitly targeted. It is not required but is strongly recommended whenever you implement hreflang — omitting it means Google may show any of your regional pages to unmatched users, which can result in poor user experience.

Hreflang supports both language-only and language+country targeting. en targets all English speakers regardless of country. en-GB targets English speakers specifically in Great Britain. en-US targets English speakers in the United States. Use language-only codes when you have one English version for all English speakers. Use language+country codes when you have region-specific content (different pricing, spelling, legal disclaimers, currencies). Country codes must be ISO 3166-1 alpha-2 (two uppercase letters). Language codes must be BCP 47 (e.g., zh-Hans for Simplified Chinese).

Google crawls and validates hreflang tags rather than blindly trusting them. The process: Googlebot crawls your page and reads the hreflang annotations; it then crawls each referenced URL to verify the return tags exist; if the return tags are missing or the URLs return errors, Google silently ignores the entire hreflang set for those pages. Errors are not reported in Search Console — there are no warning messages for most hreflang mistakes. The only way to verify correct implementation is to use hreflang validation tools or check Google Search Console's International Targeting report for indexed language signals.

The most common errors: Missing return tags — every page in the set must reference all other pages including itself (the bidirectionality requirement); Wrong locale codes — using en-uk instead of en-GB or zh instead of zh-Hans; Mismatched URLs — the hreflang URL does not match the canonical URL (e.g., pointing to a redirect instead of the final URL); Inconsistent protocol — mixing http and https across annotations; Missing x-default — no fallback specified; Implementation only on some pages — hreflang must be on all pages in the language set, not just the homepage. Use hreflang validation tools to catch these before publishing.

Hreflang itself is not a direct ranking signal — it tells Google which page to serve to which users, but it does not boost rankings. The SEO benefit is indirect: by ensuring the correct language/region page is served to each user, you reduce pogo-sticking (users clicking back immediately), improve relevance signals, and prevent duplicate content from competing against itself. If your UK and US pages are both indexed with the same English content, hreflang prevents them from cannibalizing each other's rankings and ensures each page accumulates regional backlink authority. Combine hreflang with country-targeted domains or subdirectories and locally relevant content for the best regional SEO results.

Three common structures each have trade-offs: ccTLDs (country-code top-level domains, e.g., example.fr) send the strongest country-targeting signal to Google but require separate domain authority for each. Subdirectories (e.g., example.com/fr/) consolidate all link authority under one domain, are easiest to manage, and are recommended by Google for most sites. Subdomains (e.g., fr.example.com) are treated like separate sites by Google, similar to ccTLDs but without the strong geo-signal. For new international sites, subdirectories on a strong domain are typically the best balance of SEO authority and operational simplicity.

About This Hreflang Generator

This free hreflang generator builds the <link rel="alternate" hreflang="..."> tags needed to tell search engines about language and regional variants of your pages. Enter each language–URL pair and get the full set of tags to paste into every variant's <head>.

Hreflang tags prevent international SEO issues caused by serving the same content in multiple languages or regions. When implemented correctly, each language or region version ranks in its target market rather than competing with the others.

When to use this tool

  • Setting up hreflang for multilingual websites
  • Targeting the same language in multiple regions (e.g. en-US and en-GB)
  • Verifying that the x-default tag is included
  • Generating correct BCP 47 language codes for each region

How It Works

Add Language Variants

Enter each URL variant with its hreflang code. Click the common codes to auto-fill the language field quickly.

Choose Output Format

Switch between HTML link tags (for <head>), HTTP headers, or XML sitemap xhtml:link format depending on your implementation preference.

Copy to All Pages

Copy the generated tags and add the same full set to every page in the language group — each page must include tags for all variants.

Common Use Cases

Multilingual Websites

Sites with content in English, French, Spanish, etc. use hreflang to ensure Google shows users the version matching their browser language.

Country-Specific Sites

E-commerce sites with US, UK, and AU versions of the same page use en-US, en-GB, en-AU hreflang tags to serve the right pricing and currency.

Duplicate Content Prevention

For pages with similar content in multiple languages, hreflang prevents Google from treating them as duplicate content and diluting ranking signals.

International SEO Campaigns

Brands expanding into new markets use hreflang to ensure their translated landing pages rank in the target country's Google, not in the origin country's index.

Site Migrations

When restructuring a multilingual site (e.g., changing URL structure), hreflang helps Google re-map the correct relationships between old and new URLs.

Language Selector Pages

Use x-default to designate a global landing page that lets users choose their language, so Google knows where to send visitors with no matching locale.

Related Articles

View all articles
Hreflang x-default: What Happens to Users Your Language Tags Don't Cover

Hreflang x-default: What Happens to Users Your Language Tags Don't Cover

"x-default" isn't a language code — it's a special hreflang value meaning "show this to anyone whose language/region didn't match any other entry." Omitting it doesn't make hreflang "invalid," but it delegates the "what do unmatched users see" decision to search engines' own logic. Here's the choice between a generic-international version and a language-selector page, why the selector page itself needs to participate in the reciprocal hreflang set, and why "x-default" never happens implicitly just because a URL "feels like" the main one.

Jun 14, 2026
Geo-Redirects vs Hreflang: How Automatic IP-Based Redirects Can Silently Break Your International SEO

Geo-Redirects vs Hreflang: How Automatic IP-Based Redirects Can Silently Break Your International SEO

A search engine crawler trying to access your French-language URL might get auto-redirected to your English version, based on the crawler's own IP location — meaning the URL your hreflang tags point to is never actually reachable by crawlers. Here's why IP-based geo-redirects and hreflang conflict, and the suggestion-banner and crawler-exemption approaches that resolve it.

Jun 13, 2026
Common Hreflang Implementation Errors and How to Debug Them

Common Hreflang Implementation Errors and How to Debug Them

Most hreflang implementations have errors — missing return tags, wrong language codes, orphaned pages. Here's the seven most common hreflang mistakes, how to audit an existing implementation systematically, and what Google Search Console does and doesn't report.

Jun 10, 2026
International SEO Beyond Hreflang: URL Structure, Content Localisation, and Local Links

International SEO Beyond Hreflang: URL Structure, Content Localisation, and Local Links

Hreflang solves one problem in international SEO — the rest depends on URL structure choice, genuine content localisation vs. translation, and local link building. Here's the complete international SEO framework that hreflang fits into.

Jun 8, 2026
Hreflang Generator — Create Correct International SEO Tags Instantly

Hreflang Generator — Create Correct International SEO Tags Instantly

Learn how hreflang tags work, the strict bidirectionality rules, language and region code formats, and how to use a free hreflang generator to target the right content to the right international audience.

Jun 6, 2026