Hreflang Generator
Create hreflang tags for multi-language and multi-region sites.
<!-- Fill in the form above -->Related Tools
Meta Tag Generator
Generate meta tags, Open Graph tags, and Twitter Card markup for any page. Real-time preview with copy and download.
Use tool →Canonical Checker
Verify canonical URL tags in your page source.
Use tool →Robots.txt Generator
Build a robots.txt file with User-agent, Allow, Disallow, and Sitemap directives.
Use tool →Schema.org Generator
Generate JSON-LD structured data for LocalBusiness, Product, FAQ, Article, and 12+ schema types.
Use tool →How to Use the Hreflang Generator
Add a language version for each translation of your page. Pick the language, optionally pick a region, and paste the full URL. The generator builds the <link rel="alternate"> tags you need. Copy the output and drop it into your page's <head>.
Set an x-default URL if you have a language-neutral landing page or want to control what users see when none of your specified languages match. Every tag is generated with properly escaped attributes, so the markup is always valid HTML.
What Are Hreflang Tags?
Hreflang tags tell search engines which language and regional version of a page to show in results. If you have an English page and a Spanish page covering the same content, hreflang tags prevent Google from picking the wrong one for a given user. Without them, your Spanish page might show up for English searchers, or vice versa.
They're essential for any site serving content in multiple languages or targeting different countries with the same language (English for the US vs. English for the UK, for example). Search engines don't guess well here. Tell them explicitly.
Common Hreflang Mistakes
The most common mistake is forgetting reciprocal links. If page A points to page B with hreflang, page B must point back to page A. One-way hreflang tags get ignored. Second most common: using wrong language or region codes. It's en-GB, not en-UK. ISO codes aren't always intuitive.
Forgetting x-default is another frequent oversight. Without it, search engines have to guess what to show users who don't match any of your specified languages. That guess is usually wrong. Set an x-default and remove the ambiguity.
Link Tags, Sitemap, or HTTP Headers?
There are three valid ways to publish hreflang annotations, and Google treats them equally. The <link> tags this generator builds go in each page's head and are the easiest to debug, since you can view source and see them. XML sitemap annotations keep hreflang out of your templates entirely and scale better when you have thousands of pages or dozens of languages, because each new language means touching one file instead of every page. HTTP headers are the fallback for non-HTML files like PDFs.
Pick one method and stick with it. Publishing hreflang in two places invites the two to disagree, and conflicting annotations get ignored. For most sites under a few hundred pages, head tags are the right call.
One more thing worth knowing: hreflang is a Google and Yandex feature. Bing mostly relies on the content-language meta tag and its own geo-detection instead. If Bing traffic matters to you, set that tag too. It doesn't conflict with hreflang.
What is x-default and do I need it? +
Do I need hreflang if I only have one language? +
Should hreflang go in the HTML head or the sitemap? +
<head> is simpler and easier to debug. Putting them in your XML sitemap scales better for large sites with hundreds of language variants. Pick one approach and stick with it. Don't mix both for the same pages.