Skip to content
toolgrid

No tool found. Try another word.

Hreflang Tag Generator

Generate hreflang link tags for every language and region version of a page, with x-default. Language codes are checked and normalised.

Result

Put the full set of tags on every language version, including a link to the page itself.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the Hreflang Tag Generator

  1. 1 List each version as "language code | URL", e.g. "de-AT | https://example.com/at/".
  2. 2 Add the default URL for visitors whose language isn't listed.
  3. 3 Copy the tags into the <head> of every version of the page.

About the Hreflang Tag Generator

hreflang tags tell search engines which language and regional versions of a page exist, so a searcher in Germany is shown the German page and a searcher in Belgium the Belgian one. Without them, Google may show the wrong version or treat translations as duplicates.

Each tag uses an ISO 639-1 language code (en, de, nl), optionally followed by an ISO 3166-1 region code (en-GB, nl-BE) or a script (zh-Hant). The generator normalises the letter case, accepts an underscore instead of a hyphen and adds an x-default tag for visitors that match none of the versions. Lines with an invalid code or URL are listed so you can fix them.

hreflang only works when it is reciprocal: every version must list all versions, including itself, with absolute URLs. Use canonical URLs (not redirects) and keep the set identical across the pages. Region codes alone (such as "uk") are not valid; use "en-GB".

Frequently asked questions

What is x-default?

The page shown to users whose language or region doesn't match any of your versions, often a language selector or the international English page.

Is "en-UK" correct?

No. The region code for the United Kingdom is GB, so use en-GB.

Do I need a tag pointing to the page itself?

Yes. Every version should list all versions, including itself.

Can I put hreflang in the sitemap instead?

Yes, Google also reads hreflang from XML sitemaps and HTTP headers. Use one method consistently.