Hreflang Tag Generator.
Add a row for each language version of your page, pick a locale, and get a clean, copy-ready set of <link rel="alternate" hreflang="…"> tags — with x-default added for you. Everything runs in your browser.
x-default is added automatically using your first URL unless you set one explicitly. Place the generated tags in the <head> of every language version, or in your XML sitemap.
All processing happens in your browser. Nothing you type is uploaded to any server. See our local SEO guide.
Sample output
Here is a realistic example of what this tool produces, so you know what to expect before you start.
Input — an English page plus a Spanish version
https://example.com/ (English, US) and https://example.com/es/ (Spanish, US)
Output — hreflang link tags
<link rel="alternate" hreflang="en-us" href="https://example.com/" />
<link rel="alternate" hreflang="es-us" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Each page in the set must reference every other page, including itself, plus one x-default fallback. The generator outputs the complete reciprocal block so you can paste it into each URL.
Why hreflang matters for multilingual sites
Many businesses serve more than one language market. A dental clinic in Miami might want English and Spanish versions of its homepage. A boutique in Dubai may publish in English and Arabic. A jeweller in Ahmedabad might want Gujarati for local walk-ins, Hindi for shoppers across North India and English for customers abroad. The moment you create the same page in more than one language, you have to tell Google which version belongs to which audience. That is exactly what the hreflang tag does.
Without hreflang, two things go wrong. First, Google may show the wrong language to the wrong person — a Spanish speaker in Miami lands on your English page, bounces, and your rankings quietly slide because of poor engagement. Second, Google may treat your Spanish, Arabic and English versions as near-duplicate pages competing against each other, splitting your authority instead of consolidating it. Hreflang resolves both: it groups the versions into one "cluster" and lets Google serve the right language for each user's settings and location.
The payoff is concrete. Users who find content in their own language convert at a much higher rate, and non-English queries are often far less competitive. A correctly tagged Spanish (es-US), Arabic (ar-AE) or Marathi (mr-IN) page can capture intent that an English-only competitor never sees. The hreflang tag is the small piece of plumbing that makes that multilingual strategy actually work in search results.
How to use this hreflang generator
Add a row per language version. Click "Add row" once for each translated page you have. A salon with English, Spanish and French pages needs three rows.
Paste the full URL. Always use absolute URLs (https://example.com/hi/...), never relative paths. Each version should point to its own canonical URL.
Pick the locale. Choose from the dropdown — en-US, en-GB, es-ES, fr-FR, ar-AE, hi-IN and more — or x-default.
Generate and review. The tool outputs the full set of link tags and auto-adds an x-default so search engines always have a fallback.
Copy into every version. The most important step: paste the same complete block into the head of every page in the set, so the tags are reciprocal.
Common hreflang mistakes (and how to avoid them)
- Missing return tags. This is the number one error in Search Console. If your English page references the Spanish page but the Spanish page does not reference English back, Google discards the whole set. Hreflang must be reciprocal — every page lists every version, including itself.
- Wrong language or region codes. Use ISO 639-1 for language (en, es, hi) and ISO 3166-1 Alpha-2 for region (US, GB, AE, IN). A common slip is writing "in-IN" instead of "hi-IN" — "in" is not a valid language code for Hindi. The language always comes first, the country second.
- Using relative URLs. Hreflang only accepts fully-qualified absolute URLs. A path like /hi/menu is silently ignored. This generator keeps your URLs exactly as entered, so paste the complete https:// address.
- No x-default. Without an x-default, users whose language is not in your set get an arbitrary version. Always include one — usually your English or language-selector page. This tool adds it for you.
- Pointing to non-canonical or redirecting URLs. Each hreflang URL should be the live, indexable, canonical version of that page — not a URL that redirects or carries a canonical tag pointing elsewhere.
The reciprocal requirement, explained simply
Think of hreflang as a group of friends who all have to agree they know each other. If page A claims "B is my Spanish version" but page B never confirms "A is my English version", Google treats A's claim as unverified and ignores it. For a three-language set — English, Spanish, French — every one of the three pages must carry the complete list of all three (plus x-default). That is twelve link tags per page if you have four entries, repeated identically across all pages. It feels repetitive, but that symmetry is precisely what makes the system trustworthy to a crawler.
The practical workflow: generate the block once here, then paste the identical block into the head of every language version. Because the URLs are absolute and the set is the same everywhere, reciprocity is guaranteed. If you later add a German (de-DE) page, you must regenerate and update the block on all pages, not just the new one.
Where to put the generated tags
You have three valid options, and you should pick exactly one to avoid conflicting signals. The most common is placing the link tags in the <head> section of each HTML page — that is the output this tool produces. Alternatively, large sites often declare hreflang inside the XML sitemap, which keeps the page markup lean; if you go that route, our sitemap generator helps you build the file. The third option, HTTP Link headers, is mainly for non-HTML files like PDFs. For most small-business sites, the head-tag approach this generator outputs is the simplest and most reliable. While you are tightening up technical SEO, make sure crawlers can reach every version by checking your robots.txt rules too.
Frequently asked questions
What is an hreflang tag and when do I need one?
An hreflang tag is a link element that tells Google which language and regional version of a page to show a given user. You need it whenever the same content exists in more than one language or region — for example a Spanish version and an English version of your homepage, or separate pages for the UK and the UAE. Without it, Google may serve the wrong language version or treat your translations as duplicate content.
Do hreflang tags need to be reciprocal?
Yes. Hreflang annotations must be bidirectional. If your English page points to your Spanish page with hreflang, your Spanish page must point back to your English page in return. Google calls these return tags. If page A references page B but B does not reference A, Google ignores the entire set as invalid. This is the single most common reason hreflang fails in Search Console.
What is x-default in hreflang?
The x-default value tells search engines which page to show when no other language or region in your set matches the user. It is typically your main or English landing page, or a language-selector page. It is optional but strongly recommended — this generator adds an x-default entry automatically so you do not forget it.
Should I use hi-IN or just hi for Hindi?
Use just the language code (hi) if the page targets all Hindi speakers worldwide regardless of country. Use the language-region code (hi-IN) if the page is specifically for Hindi speakers in India. Region codes use ISO 3166-1 Alpha-2 country codes, so India is IN, not INDIA or 91. For a business serving a local audience in one country, region-specific codes such as hi-IN or es-MX are the right choice.
Keep building.
Your entire online presence, on one subscription.
Multi-language sites, free domain, SEO autopilot and Google Business guidance from $9/month billed yearly.