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
Frequently Asked Questions
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.<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.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).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.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
Standards & References
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 SEO Tools
Related Articles
View all articles
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.
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.
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.
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.
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.