Hreflang Generator
<link rel="alternate" hreflang> tags for every language version of a page
Frequently asked questions
What format should a language code be?
A 2–3 letter ISO 639-1 language code, optionally followed by a hyphen and a 2-letter ISO 3166-1 region code — e.g. "en", "pt-BR", "zh-TW". Region alone (without a language) isn't valid.
What does x-default do?
It marks the page search engines should show visitors whose language doesn't match any of your listed hreflang entries — commonly a language-selector page or your default-locale version.
Do hreflang tags need to be reciprocal?
Yes — every page in the set should link to every other page (including itself), or search engines may ignore the annotations. Each page you generate tags for needs the same tag block, just with the current page's URL included.
Rules the generator enforces
- Format — lang-REGION (de-AT) or bare lang (de); wrong-order combos fail validation with the fix shown.
- Mutual links — hreflang requires bidirectional annotations; missing return-links are the most common penalty, added automatically here.
- x-default — exactly one, pointing at the language selector or global page.
- Output forms — HTML head link tags, HTTP Link-header, and sitemap alternates depending on where you control markup.
Language alternates without the classic mistakes
Region + language combos validate against CLDR conventions, x-default gets set once, and return-tags auto-pair so siblings reference each other.
Quick-add locale buttons
Eleven common codes, en, zh, zh-TW, de, es, fr, hi, ja, ko, pt, and ru, add a language row with one click, while any other code can be typed and validated.
x-default fallback
An optional x-default URL tells search engines which page to show visitors outside your language list, closing the gap for regions you do not target.
Code validation built in
Codes are checked against the two-to-three-letter language pattern with an optional region before the tags build, so a mistyped locale never sends users to the wrong page.
Related tools
What Is an Hreflang Generator?
When one page exists in several languages or regional variants, search engines cannot reliably guess which version belongs to which audience from visible text alone. Hreflang annotations solve that: link rel alternate elements in the page head, each pairing a code such as en, de or zh-TW with the full URL of that version, plus an optional x-default fallback. Crawlers read the whole cluster together and serve the German page to German searchers and the US page to US searchers instead of guessing.
How the tag builder mirrors the cluster
- 🌍 One-click quick-add for eleven frequent codes: en, zh, zh-TW, de, es, fr, hi, ja, ko, pt and ru, with free entry for the rest
- ⌨️ Live code check tinting the language box red when a code breaks the lowercase plus optional uppercase-region shape
- 🔗 One alternate line per language plus URL row, skipping blank rows so drafts never emit broken tags
- 🎯 Optional x-default fallback line appended after the language lines
- 📋 Copy to clipboard or download the block as hreflang-tags.html
Projects that reach for hreflang first
- 🌐 Launching a site in several languages and wiring the cluster before the first crawl
- ➕ Adding a new locale to a live multilingual site without orphaning the old versions
- 🔄 Fixing results that keep showing the wrong-language page to the wrong country
Reciprocity rules and honest limits
- ↩️ Every version must carry the full set pointing at all the others, so paste the block into each head, never just one
- 🔍 Hreflang is a strong hint, not a redirect: it guides which version ranks, never forcing a visitor elsewhere
Assembly happens entirely on your own device with no uploads and no stored copies, so unpublished URLs stay yours until you publish them.
Last updated · 2026-09-01
Related tools
Meta Tags Generator
Title, description, keywords, canonical and robots meta tags with a live Google search preview
SERP Previewer
See exactly how your title and description look in Google results — with pixel-accurate truncation warnings.
UTM Link Generator
Build clean, correctly-encoded campaign links in seconds — with one-tap presets for Facebook Ads, Google Ads and more.