Hreflang Tag Generator

Generate hreflang tags for multilingual and multi-region pages.

<link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="en-gb" href="https://example.com/gb/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />

hreflang tells Google which language/region version of a page to show each user. Put these in the <head> of every version, and make sure each version links to all the others (including itself). Codes are ISO language (en) optionally with a region (en-gb). Runs in your browser.

Generate hreflang link tags that tell search engines which language or region version of a page to show each user. Add each version's hreflang code and URL, optionally set an x-default fallback, and copy the tags into the <head> of every version. Correct hreflang prevents the wrong-language page ranking in a given country. Runs in your browser.

How to use the Hreflang Tag Generator

  1. Add each language/region version with its hreflang code and URL.
  2. Optionally set an x-default fallback URL.
  3. Copy the tags into the <head> of every version.

Frequently asked questions

What format are hreflang codes?

An ISO 639-1 language code (e.g. en, fr, de), optionally with an ISO 3166-1 region (e.g. en-gb, en-us, pt-br). Use language only when the page targets a language regardless of country.

Do all versions need the tags?

Yes. hreflang must be reciprocal β€” every version should list all versions including itself, otherwise search engines may ignore the annotations.

What is x-default?

x-default specifies the fallback page for users whose language/region you don't explicitly target β€” often a language selector or your main international page.