Hreflang tag generator.

Build the HTML tags, sitemap block and HTTP header for each language version, and check them before you publish.

Loading the generator.

How to use this hreflang generator

  1. Add one row per version: the full page URL, the language, and a country only when that page is for one country.
  2. Mark one URL as x-default if you have a page for everyone else.
  3. Read the checker. Fix anything in red, then copy one format. Put that same set on every URL.

You can also paste a CSV: url,hreflang, with yes in a third column for x-default. For the indexing side of a multi-language site, see technical SEO.

Mistakes this hreflang checker catches

Google’s localized versions guide is the source for every check below.

  • Bad codes. The value is an ISO 639-1 language and, if you need a country, an ISO 3166-1 alpha-2 region. en-UK fails because the United Kingdom is GB. es-419 fails because Google does not support UN region codes.
  • Missing return tags and self-reference. Each version must list itself and every other version. The sitemap block does that: every URL is an entry, and every entry repeats the full set.
  • Duplicates. One URL per hreflang, and one hreflang per URL. x-default may point at a URL that also has a language.
  • Mixed http and https. Alternate URLs must be fully qualified, and the two protocols are different pages. Use https for all of them.
  • x-default. Optional. Use it once, for visitors who match none of the languages.

Google also says hreflang does not set the language of the page. The words on the page still have to match the audience.

Search Lift

Language versions still need a clean site.

Tags do not fix the wrong canonical, a redirect loop, or a page that is not actually in that language. Technical SEO is where we check that the versions Google sees are the ones you meant.

FAQs

What is an hreflang tag generator?

It writes the tags that tell Google which URL is for which language or country. You list each version once. The tool gives you the HTML link tags, the sitemap block and the HTTP Link header, and it checks the set before you copy it.

What is an hreflang checker looking for?

The mistakes Google’s own rules catch: a code that is not ISO 639-1 or ISO 3166-1, such as en-UK instead of en-GB; the same language listed twice; two languages sharing one URL; a mix of http and https; a missing self-reference; and a set that does not list every version on every version. Those last two are the return-tag rule.

What is x-default?

x-default is the fallback URL for visitors whose language is not in your list. Google suggests it for language choosers and for homepages that redirect. It is not a country. Use it once, on the page you want those visitors to land on.

Where do the tags go?

Put the same HTML link tags in the head of every URL in the cluster, or send the same Link header, or list every URL in the sitemap with the same xhtml:link children, including itself. Google says you only need one of the three methods.

Why is en-UK rejected?

UK is not an ISO 3166-1 country code. The United Kingdom is GB, so English for the UK is en-GB. The language code uk means Ukrainian, not the United Kingdom.

Does hreflang choose the language of the page?

No. Google says it does not use hreflang to detect the language of a page. It uses hreflang to understand that these URLs are localized versions of the same content. The page itself still needs to be in that language.