hreflang Tag Generator
Build a reciprocal hreflang set for a multilingual page.
What you provide
What to serve a visitor whose language matches nothing in your list.
Result
CHECK4 hreflang tags for 4 languages
hreflang only works when it is reciprocal. Every page in the set must carry the full list including a tag pointing at itself, and if one page in the group omits the others, search engines discard the relationship rather than guessing at it. Adding an x-default is worth doing: it tells search engines what to serve to a visitor whose language matches nothing in your list. Region codes are optional and often overused, since en-GB and en-US only need separating when the pages genuinely differ.
<link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" /> <link rel="alternate" hreflang="de" href="https://example.com/de/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
- Languages
- 4
- x-default set
- no
- Tags generated
- 4
- en
- https://example.com/
- en-GB
- https://example.com/uk/
- de
- https://example.com/de/
- fr
- https://example.com/fr/
What this cannot tell you
- Generates tags from what you enter. It does not fetch your pages or verify that the URLs resolve.
- It cannot check reciprocity, which is the requirement hreflang fails on most often. Every page in the set has to carry the full list, and only a crawl of all of them can confirm that.
Take this with you
How this calculation works
Each language and URL pair becomes a link element with a validated language tag. The codes are checked against the expected shape, which is a two or three-letter language optionally followed by a region in capitals, and duplicates are rejected because the same combination cannot appear twice in one set. An x-default entry is added if you supply one. The output goes in the head of every page in the group, unchanged, including the tag that points at the page itself.
What the results mean
- Self-referencing tag
- Each page must include a tag pointing at itself. The set is a group definition rather than a list of alternatives, and leaving the page out of its own group breaks it.
- x-default
- The fallback for visitors whose language matches nothing listed. Usually a language selector or your primary market page.
- Region codes
- Optional and frequently overused. Only separate en-GB from en-US when the pages genuinely differ in content, pricing or availability.
Common problems and fixes
- The tags are in place but search engines ignore them
- Almost always a reciprocity failure. If page A lists page B but page B does not list page A, the relationship is discarded entirely rather than partially honoured. Check that every page in the group carries the complete set, that the URLs match exactly including trailing slashes, and that each one is absolute.
- The wrong regional version keeps appearing
- Check the canonical tags first, since a canonical pointing at a different language overrides the whole arrangement and is the most common cause. Then confirm the URLs in your hreflang set match the canonical URL of each page exactly, because a mismatch of scheme, host or trailing slash is treated as a different page.
Frequently asked questions
Do I need region codes?
Only when the pages genuinely differ for those regions. A single Spanish page serving every Spanish-speaking market should be es, not es-ES. Adding regions you do not actually differentiate creates a larger set with more ways to break and no benefit.
Can I put hreflang in the sitemap instead?
Yes, and for a large site it is easier to maintain than tags across hundreds of templates. The rules are identical, including reciprocity. Pick one method and use it consistently, since a sitemap and a set of tags that disagree is worse than either alone.
Does hreflang help rankings?
Not directly. It does not make any page rank higher. What it does is help the right version of a page get shown to the right audience, which improves how people experience the result and reduces the chance of two of your own pages competing for the same query.
Put this on your own site
Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.
<iframe src="https://runthetests.com/embed/hreflang-generator/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="hreflang Tag Generator" loading="lazy"></iframe>
Preview it at https://runthetests.com/embed/hreflang-generator/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.