Hreflang Tag Generator
Generate hreflang link tags for multilingual SEO.
Tags Count: 5x-default: Set
Why hreflang matters
The hreflang attribute tells search engines which language and regional version of a page to serve, preventing duplicate-content issues across localized sites. Each variant lists every other variant (including itself), and an x-default entry catches users whose language you don't target. Use ISO 639-1 language codes, optionally with an ISO 3166-1 region (e.g. en-GB). Tags are generated locally in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Producing hreflang tags for a set of language versions of one page.
- Getting the language and region code format right for a market.
- Adding an x-default entry for visitors outside your named regions.
- Producing a consistent tag set across a multilingual template.
- Generating tags to compare against what a site currently outputs.
Frequently Asked Questions
- What does hreflang actually do?
- It tells search engines that several URLs are the same page in different languages or regions, so the right one is shown to each searcher. It does not change rankings and it is not a redirect — it is a mapping between equivalents.
- Why must the tags be reciprocal?
- Because Google ignores one-sided annotations. If the English page points at the German one, the German page must point back — and both must include a self-referencing tag. A missing return link is the single most common hreflang error in Search Console.
- What is x-default for?
- The fallback for anyone whose language or region you have not covered — usually a language selector or the international English version. It is optional, but without it a Spanish-speaking visitor from a country you never targeted gets an arbitrary choice.
- What format do the codes take?
- ISO 639-1 for language, optionally plus ISO 3166-1 Alpha-2 for region: `en`, `en-GB`, `pt-BR`. Region alone is invalid — `hreflang="uk"` means Ukrainian, not the United Kingdom, which is a mistake that appears on a remarkable number of live sites.
- Where should the tags go?
- In the `<head>`, in an XML sitemap, or as HTTP headers — pick exactly one method. Mixing them is where contradictions creep in, and a set of tags that disagrees with itself is ignored wholesale rather than partially honoured.
- What happens when a page has no equivalent in another language?
- Omit it rather than pointing at a near-match or the home page. A cluster where one member links to a page that does not reciprocate is treated as unreliable, and a wrong mapping is worse than a missing one.
Common errors and gotchas
- Omitting the self-referencing tag, which invalidates the whole set for that page.
- Making the references non-reciprocal, where page A points at B but B does not point back.
- Using a country code as a language code, which are different vocabularies.
- Pointing hreflang at a URL that redirects or is canonicalised elsewhere.
- Adding hreflang while the pages are near-duplicates in one language, which does not solve duplication.
Related Web & SEO tools
Meta Tag Generator
Build SEO title, description, and viewport meta tags.
Open Graph Generator
Generate Open Graph and Twitter Card meta tags.
Robots.txt Generator
Build a robots.txt file with per-bot rules. Block AI crawlers, set crawl delays, define sitemaps.
UTM Campaign URL Builder
Append UTM parameters to build trackable campaign URLs.
Sitemap XML Generator
Build an XML sitemap from a list of URLs.
SERP Snippet Preview
Preview how your page title and meta description appear in Google search.
Meta Tag Analyzer
Paste a page's HTML head to audit its title, meta, and social tags.
Keyword Density Checker
Count word frequency and keyword density in your content.