Hreflang Tag Generator

Build a complete hreflang set, with the self-reference and return tags that make it work.

One per line: en-GB | https://example.com/en/

Optional. Shown when no language matches.

100 runs left today · sign up for more

About this tool

List each language version as `code | url`, one per line, and this builds the full tag set for every page in the cluster.

Hreflang is unusually unforgiving. Every page must link to every other page *and to itself*, and one missing return tag invalidates the whole cluster — silently, with no error anywhere. Two mistakes cause most failures: leaving out the self-reference, and writing a country code where a language code belongs. `uk` is not a language; `en-GB` is.

Common questions

Why does every page need to link to itself?

The self-reference is what confirms which version of the set a page is. Without it a search engine cannot tell whether the page belongs to the cluster at all, and the annotations are discarded.

What is x-default for?

The page to show when no listed language matches the user. A language selector or a global English version is typical. It is optional, and useful when your set does not cover every visitor.

Is "uk" a valid hreflang code?

It is valid, but it means Ukrainian. For the United Kingdom you want en-GB, because the first subtag is always a language. If you genuinely serve Ukrainian, "uk" is exactly right and this tool will not tell you otherwise.

Where should these tags go?

In the head of every page in the set, in an HTTP header, or in the sitemap — one of the three, applied consistently. Mixing methods across a site makes conflicts very hard to trace.