Hreflang Tag Generator

Create correct hreflang tags for websites with different language or country versions, including x-default.

Bilal KhizriFree tool by Bilal Khizri · No sign-up · Works on mobile
💡 In simple words: Some websites have one page in English for the UK, another for the USA, and another in Urdu. Hreflang tags tell Google which version to show to which people, so a visitor in London sees the UK page and not the American one. Add your pages and this tool writes the tags.

Add one row per version of the same page.

How to use the hreflang generator

  1. Add a row for each language or country version of the same page, with its full URL.
  2. Add an x-default URL, usually your main or international page, for visitors who match none of the versions.
  3. Choose HTML tags (for the page head) or XML sitemap format.
  4. Place the same complete set of tags on every version of the page.

What is hreflang?

Hreflang is an HTML attribute that tells Google a page has versions in other languages or for other countries. It helps Google show the right version, for example the UK page with prices in pounds to UK searchers, and prevents your versions competing with each other.

Hreflang rules that matter

Frequently Asked Questions

Do I need hreflang if my site is only in English?

Only if you have separate pages for different English-speaking countries, such as UK and US versions. A single-language, single-country site does not need it.

What is x-default in hreflang?

It tells Google which page to show visitors whose language or country does not match any version you listed.

Is it en-UK or en-GB?

en-GB. The country code for the United Kingdom is GB.

Should I use HTML tags or the sitemap?

Both work. HTML tags are simpler for small sites; the XML sitemap is easier to manage for large sites.

Related Free Tools