Hreflang Tag Generator - International SEO
Generate valid hreflang link tags for multilingual websites, including the x-default fallback and the XML sitemap variant. With duplicate and URL validation. Free, in your browser.
Generate correct hreflang tags for multilingual sites
This generator builds the full set of link rel="alternate" hreflang tags for a multilingual or multi-regional page. Pick a language from the dropdown, optionally add a two-letter region code, paste the URL for each version, and toggle the x-default fallback. The output is available both as HTML head tags and as the xhtml:link variant used inside XML sitemaps.
Hreflang tells Google and Yandex which language and regional version of a page to show each searcher. International e-commerce stores use it to send German shoppers to the de-DE catalog with euro prices, SaaS companies use it to separate en-US and en-GB spellings, and publishers use it to keep translated articles from competing against each other in the same results page.
The generator validates as you type: it flags duplicate locales, warns when a URL is relative instead of absolute, and checks that region codes are valid two-letter ISO 3166-1 format. It also reminds you of the most common hreflang failure: annotations must be reciprocal, so every listed URL needs the identical tag set pointing back, or search engines discard the whole cluster.
For large sites, the sitemap variant is usually the better home for hreflang because it keeps page HTML lean; a site with 20 languages would otherwise carry 21 link tags on every page, including the self-reference. The x-default entry catches visitors whose language matches none of your versions, typically pointing at your global or English page.
Hreflang works best alongside solid on-page metadata. Generate titles and descriptions per language with the Meta Tag Generator, and preview how each version appears in results with the SERP Snippet Preview, both free on ToolForte. Like this generator, they run entirely in your browser, so you can prepare a full international rollout, tags, titles, and snippets included, without sending unpublished URLs to any external service.
How the Hreflang Generator Works
- 01Add a row per language version: pick the language code, optionally add a two-letter region, and paste that version's absolute URL.
- 02Toggle x-default on and set the fallback URL for visitors whose language matches none of your versions.
- 03The tool validates for duplicate locales, relative URLs, and malformed region codes as you type.
- 04Copy the output as HTML head tags or switch tabs for the xhtml:link block used in XML sitemaps.
Implementing Hreflang Without the Classic Mistakes
Hreflang fails silently, so precision matters. The three rules that prevent most failures: use absolute URLs, make annotations reciprocal, and include a self-reference. Reciprocal means that if your English page lists the German version, the German page must carry the identical tag set pointing back, including a tag referencing itself; search engines that find a one-way annotation discard the entire cluster. Codes must be ISO 639-1 for language and ISO 3166-1 alpha-2 for region, in the language-REGION order like en-GB, and a region can never stand alone. Choose one of three placements and stick with it: link tags in the HTML head, an X-Robots-Tag style HTTP header for non-HTML files like PDFs, or xhtml:link entries in your XML sitemap. The sitemap route scales best for large sites, since a site with twenty languages would otherwise ship twenty-one link tags on every single page. Add x-default to name the version for unmatched languages, typically your global English page or a language selector. After deployment, verify in Google Search Console's international targeting reports and crawl a few pages to confirm every version returns the same complete tag cluster.
When to Use the Hreflang Generator
Use it whenever the same content exists in more than one language or is targeted at more than one country: launching translated versions of a site, splitting en-US and en-GB content with different spellings and currencies, or running country-specific stores on separate domains or subfolders. It is also the fix when Google shows the wrong language version in a country's search results, or when translated pages cannibalize each other's rankings. Generate the cluster once per page template, then reuse the structure across your site or sitemap generator.
Common Use Cases
- Launching translated versions of a marketing site across European markets.
- Separating US and UK English pages with different pricing and spelling.
- Generating xhtml:link blocks for a programmatically built XML sitemap.
- Pairing each language version with correctly localized titles and descriptions. Meta Tag Generator - SEO Tags in Seconds
Expert Tips
- Always include the self-referencing tag; clusters without it are frequently discarded by search engines.
- Use en-GB, not en-UK: hreflang regions follow ISO 3166-1, and invalid codes invalidate the whole entry.
- Keep hreflang URLs identical to your canonical URLs; pointing hreflang at redirected or non-canonical addresses breaks the cluster.
Frequently Asked Questions
- It names the page search engines should show when a searcher's language matches none of your declared versions. It typically points at your global or English page, or at a language selection page.
- Both work identically for search engines. The head is simpler for small sites; the sitemap variant keeps HTML lean and is easier to maintain programmatically once you have many languages, which is why the tool outputs both formats.
- The most common causes are missing return links, since every listed URL must carry the identical tag set back, relative instead of absolute URLs, invalid codes like en-UK instead of en-GB, or pages that are blocked from crawling.
What does x-default do?→
Should hreflang go in the HTML head or the XML sitemap?→
Why are my hreflang tags being ignored?→
Related tools
12 suggested- 01Robots.txt Tester - Check if a URL is BlockedTest whether a URL is allowed or blocked by robots.txt for Googlebot, Bingbot, GPTBot, or any crawler. Free browser-based tester with templates.
- 02SERP Snippet Preview - Google Result SimulatorPreview your Google search snippet on desktop and mobile with real pixel-width meters and counters. Free browser-based SERP simulator for SEO work.
- 03Headline Analyzer - Score Your Titles 0-100Score headlines 0-100 on length, power words, emotion, and format, with a SERP pixel-width preview. Free browser-based analyzer with concrete tips.
- 04Hashtag Generator - Instagram, TikTok & XTurn any caption into relevant hashtags for Instagram, TikTok, and X using curated niche sets. Free browser-based generator with platform limits.
- 05UTM Link Builder - Campaign URL GeneratorBuild trackable campaign URLs with utm_source, medium, and campaign parameters, presets, and history. Free browser-based builder for marketers.
- 06Meta Tag Generator - SEO Tags in SecondsGenerate optimized SEO meta tags for your website. Title, description, Open Graph, robots, and canonical tags. Free with live preview.
- 07Open Graph Preview - Social Share TesterPreview how your page will look when shared on Facebook, Twitter, and LinkedIn. Test Open Graph tags before publishing. Free tool.
- 08robots.txt Generator - SEO Crawl ControlGenerate a robots.txt file to control search engine crawling. Set rules for specific bots and paths. Free online generator.
- 09Schema Markup Generator - JSON-LD FreeGenerate JSON-LD structured data for better search engine results. Organization, Article, FAQ, Product and more schema types.
- 10XML Sitemap Generator - Free SEO ToolGenerate valid XML sitemaps from a list of URLs. Set custom frequency, priority, and last modified dates. Free online sitemap builder.
- 11Hash Generator - SHA-256, SHA-512 & MoreGenerate SHA-1, SHA-256, SHA-384, and SHA-512 hashes securely in your browser. Uses Web Crypto API - your data never leaves your device.
- 12Lorem Ipsum Generator - Free Placeholder TextGenerate placeholder text for your designs, mockups, and layouts. Choose paragraphs, sentences, or word count. One-click copy.