Hreflang Tag Generator
Generate hreflang link tags for multilingual and multi-regional sites. Add URL and language rows, include x-default, and catch duplicate locales.
Generated hreflang tags
Paste this exact set of tags into the <head> of every page listed above — hreflang annotations must be reciprocal, and each page should include a reference to itself.
What is the Hreflang Tag Generator?
The Hreflang Tag Generator builds a complete set of <link rel="alternate" hreflang> tags for international SEO.
- Dynamic rows — add or remove language versions freely
- Common locale dropdown including x-default
- Duplicate language code detection
- URL validation per row
- Copyable, correctly escaped HTML output
- Free and fully client-side
How to use the Hreflang Tag Generator
- 1
Add a row for each language or regional version of the page.
- 2
Enter the absolute URL and pick the language code (e.g. en, en-GB, de, x-default).
- 3
Add an x-default row pointing at your fallback or language-selector page.
- 4
Fix any duplicate-language warnings the tool flags.
- 5
Copy the generated tag set into the <head> of every listed page.
About the Hreflang Tag Generator
The Hreflang Tag Generator builds a complete set of <link rel="alternate" hreflang> tags for international SEO. Add a row per language version — each with its URL and a locale picked from a list of common codes — and the tag block updates live.
It supports the special x-default value for your fallback page and warns you when the same language code is used twice, one of the most common hreflang implementation mistakes.
Everything is generated locally in your browser. It's designed for SEOs and developers rolling out multilingual sites who want correct, symmetric hreflang annotations without hand-typing dozens of tags.
Frequently asked questions
What is hreflang and why does it matter?
Hreflang tells search engines which language and regional versions of a page exist so they can serve the right one to each user — English speakers in the UK get /en-gb/, Germans get /de/. Without it, Google may rank the wrong version or treat translations as duplicates.
What is x-default used for?
x-default marks the page to show users whose language or region doesn't match any of your hreflang entries — typically a global home page or a language selector. It's optional but recommended, and it can point to the same URL as one of your language versions.
Do hreflang tags need to be reciprocal?
Yes. Every page in the set must list all the others, including itself. If page A links to B but B doesn't link back to A, Google may ignore the annotations entirely. This 'return tag' requirement is the most common cause of hreflang errors in Search Console.
What format do hreflang codes use?
Language in ISO 639-1 (en, fr, de), optionally followed by a region in ISO 3166-1 Alpha-2 (en-US, fr-CA, de-CH). You cannot use a region alone — 'gb' is invalid, 'en-GB' is correct. Scripts like zh-Hant are also supported.
Should hreflang go in HTML, headers, or the sitemap?
Any one of the three works: link tags in the <head> (what this tool generates), HTTP Link headers (useful for PDFs), or an XML sitemap. Pick one method and use it consistently — mixing methods across pages makes debugging much harder.
Related tools
Canonical Tag Generator
Generate a correct rel=canonical link tag from any URL, with optional trailing-slash and lowercase normalization. Fix duplicate content the easy way.
XML Sitemap Generator
Paste a list of URLs and generate a valid XML sitemap with lastmod, changefreq and priority. Validates URLs and downloads sitemap.xml instantly.
Meta Tag Generator
Generate SEO-ready HTML meta tags with live character counters for title and description. Free meta tag generator with robots, viewport and charset options.
Robots.txt Generator
Build a robots.txt file with user-agent rules, allow/disallow paths, crawl-delay and sitemap URL. One-click presets to allow all, block all, or block AI bots.