Generate hreflang tags that are reciprocal by construction
Build the complete, self-referencing, reciprocal hreflang set for every language and region version of your page at once, with the ISO codes validated and all three formats Google accepts: HTML, XML sitemap and HTTP header. Nothing leaves your browser.
Hreflang is the most error-prone tag in international SEO, because the rules are strict and the failures are silent. Every language version of a page has to link to every other version and to itself, the links have to be reciprocal so each side confirms the other, the codes have to be valid ISO 639-1 language and ISO 3166-1 region, and there should be an x-default for everyone else. Miss any one of those and Google quietly ignores the entire cluster, serving the wrong-language page and wasting the translation work. It is almost impossible to hand-write correctly across more than a couple of pages.
Why hreflang is worth the trouble
When you have the same content in more than one language or for more than one country, hreflang tells Google which version to show which user. Done right, a searcher in France gets your French page and a searcher in Canada gets your Canadian one, from the same ranking. Done wrong, or not at all, Google guesses, and often shows the wrong version, which reads as a broken experience and costs you the conversion the translation was meant to win.
The reciprocity trap, solved
The rule people miss is that hreflang must be reciprocal and self-referencing: every page in the set links to all the others and to itself, and every one of those links has to be confirmed by a return link on the other side. Hand-written, this falls apart the moment you add a version and forget to update the others. This tool generates one complete block that lists every version including the current one, so the identical set drops into every page and the reciprocity is correct by construction.
Validated codes, three formats
It checks that each language is a real ISO 639-1 code and each region a real ISO 3166-1 code, and flags the classic mistakes: a country name where a code belongs, a region without a language, or two pages claiming the same locale. Then it gives you the markup in all three forms Google accepts, HTML link tags for the page head, xhtml:link entries for an XML sitemap, and a Link HTTP header for non-HTML files, so you can use whichever fits your setup.
How to use it
- 1
Add your versions
For each language or region version, pick the language, optionally a region, and paste its full URL. The hreflang value, like en-US, builds itself as you choose.
- 2
Set an x-default
Add the fallback URL for users whose language or region you do not target. It is recommended, and the tool reminds you if it is missing.
- 3
Fix what it flags
Check the warnings: an invalid code, a duplicate locale, or a relative URL. These are the exact errors that make Google ignore the set, so clear them before you ship.
- 4
Pick a format and paste
Copy the HTML block into the head of every version, or use the sitemap or HTTP header form. Use one method only, never mix hreflang in the head and the sitemap for the same pages.
Common mistakes
Missing return tags
hreflang links must be reciprocal: if page A points to page B, page B must point back to A. A one-way link is ignored. Generating one complete block for every page, as this tool does, makes every link reciprocal automatically.
Forgetting the self-referencing tag
Each page must include an hreflang tag pointing to itself, not just to the other versions. Leave it out and the cluster is invalid. The generated block always includes the self tag.
Wrong or invented codes
hreflang uses ISO 639-1 language codes and ISO 3166-1 region codes, like en and GB, not uk for the United Kingdom or en_US with an underscore. Wrong codes are silently dropped. The tool validates each one.
Region without a language
You cannot target a country alone. hreflang is language first, optionally with a region: en-US is valid, US on its own is not. Always set the language.
Questions
- Do I really need a self-referencing hreflang tag?
- Yes. Every page in the cluster must list itself alongside the other versions, or Google treats the set as incomplete and may ignore it. The block this tool generates includes the self tag, so you can paste the same set into every page.
- What is x-default for?
- It is the fallback version Google shows to users whose language or region none of your other tags match. A global English page or a language-picker landing page is a common x-default. It is optional but recommended.
- Head tags, sitemap, or HTTP header?
- All three are valid and equivalent; pick one and use it consistently. HTML head tags are simplest for most sites, the XML sitemap keeps the markup out of your pages, and the HTTP header is for non-HTML files like PDFs. Do not use two methods for the same pages.
- Does hreflang help my ranking?
- Not directly. It does not make a page rank higher; it makes sure the right language or region version is the one shown to each user at whatever position you already rank. That protects the click-through and the experience.
- What is the difference between language and region?
- Language is required and comes first: en, es, de. Region is optional and narrows it to a country: en-US versus en-GB. Use a plain language when the content suits all speakers of it, and add a region only when you have country-specific pages.
Need this done properly, at scale?
The tool handles the one-off. When it's a system you're building, that's the paid version of the job, and we do that too.
SEO Services