WeblixTools
100% In-Browser • Free, No Sign-Up

Hreflang Tag Generator

List the language and country versions of a page and get the hreflang code to paste into your pages, your sitemap or your server config. Each code is checked as you type.

Language versions

English (United Kingdom)

English (United States)

German

French (Canada)

The page for everyone else, often a language picker or your main English page.

HTML tags

<link rel="alternate" hreflang="en-GB" href="https://www.hollowtreeworkshop.co.uk/tables/" />
<link rel="alternate" hreflang="en-US" href="https://www.hollowtreeworkshop.com/tables/" />
<link rel="alternate" hreflang="de" href="https://www.hollowtreeworkshop.de/tische/" />
<link rel="alternate" hreflang="fr-CA" href="https://www.hollowtreeworkshop.com/fr-ca/tables/" />
<link rel="alternate" hreflang="x-default" href="https://www.hollowtreeworkshop.com/tables/" />

Checks

  • You have en-GB and en-US but no plain "en". Adding one catches en speakers in every other country.

Put the same set on every page in the list. Each version has to point to all the others and to itself, or search engines ignore the links.

Checks every code

Flags en-UK, lone country codes, repeats and relative addresses as you type.

Three output formats

HTML link tags, sitemap entries with alternates, or an HTTP Link header.

Stays in your browser

Your page addresses are never sent to us or stored anywhere.

Tell search engines which version is for whom

If your shop has a UK page priced in pounds and a US page priced in dollars, both in English, Google may treat them as near copies and show the wrong one. hreflang fixes that. It's a set of links that says "this page is the en-GB version, that one is en-US, and this other one is German", so each searcher lands on the page meant for them.

Type a language code and the address of each version, one row per version. The code can be a language on its own, like de, or a language plus a country, like de-AT for German speakers in Austria. Under each code you'll see what it means in plain words, so a typo shows up straight away. Add an x-default address for everyone whose language isn't on your list.

Then pick where the links will live. HTML tags go in the head of each page, the XML sitemap version suits big sites where editing every template is a chore, and the HTTP header is the only option for files like PDFs. Use one method per page, not all three.

How to use it

  1. 1Add one row per version: a language code and the full page address.
  2. 2Fill in x-default with your fallback page if you have one.
  3. 3Read the checks and fix anything marked in red.
  4. 4Choose HTML tags, XML sitemap or HTTP header, then copy or download the code.

What the checker looks at

Rows with a problem are left out of the generated code until you fix them, so you never copy a broken set by accident. Codes are checked against the language and country names built into your browser, which is also where the plain-English labels come from.

  • The language must be a two-letter ISO 639-1 code. Three-letter codes like eng are flagged, because hreflang wants en.
  • A country, if you add one, must be a two-letter ISO 3166-1 code. The classic mistake is en-UK: the code for the United Kingdom is GB, so it's en-GB.
  • A country on its own, like gb or us, isn't valid. hreflang always starts with the language.
  • Script codes are allowed between the two, for example zh-Hant-TW for Traditional Chinese in Taiwan.
  • Number regions such as es-419 (Latin America) are valid language tags but Google doesn't support them, so the tool asks for a country code instead.
  • Each code and each address can appear only once, and every address has to be a full URL starting with http:// or https://.

The rule people miss: every page lists every page

hreflang only works when the links go both ways. If your English page points to the German page but the German page doesn't point back, Google ignores the pair. Each version also has to include a link to itself. That's why the tool gives you one complete block: paste the same block on every page in the set, without editing it per page.

The sitemap output does this for you. It writes a separate url entry for each address, and every entry carries the full list of alternates, its own included.

Language only, or language and country

Use a plain language code when one page serves all speakers of that language, wherever they are. Add a country only when you really have different pages, say different prices, delivery terms or spelling. A common pattern is en-GB and en-US for the two markets you target, plus a plain en page as the catch-all for English speakers in Ireland, India or Australia. If you list two regional English pages without a plain en, the tool points that out as a tip, not an error.

x-default is separate from all of these. It's the page shown when nothing else matches, often a language picker or your main international page.

Which output to use

  • HTML tags: easiest for small sites and CMS themes. They go inside the head of each page.
  • XML sitemap: handy when you have hundreds of pages, because you change one file instead of every template. Keep the xhtml namespace line at the top.
  • HTTP header: for files that have no head section, such as PDF downloads. Add it in your server or CDN settings.

Related tools

Reviews

What Our Users Say

Real feedback from people using WeblixTools, checked by our team before it appears.

5.0 out of 5 · 1 review

very nice

good ho gye g maza hi a gye
October 2026
See all reviews

Frequently Asked Questions

Is hreflang a ranking factor?

Not directly. It doesn't push a page up the results. It helps Google pick which of your existing versions to show, so a searcher in Vienna gets the de-AT page instead of the German one with the wrong prices.

Why is en-UK wrong?

hreflang uses ISO 3166-1 country codes, and the code for the United Kingdom is GB. en-UK looks right to most people but search engines don't recognise it, so the link is ignored. Write en-GB instead.

Do I need x-default?

It's optional but worth adding. Without it, someone whose language isn't on your list gets whichever version Google picks for them. With it, they get the page you chose, usually a language picker or your main site.

Does each page need a link to itself?

Yes. Every version should list all the versions, itself included, with the same set of links. The easiest way is to paste the exact block this tool gives you into every page of the set.

Can I use hreflang in the sitemap and in the HTML at the same time?

You can, but there's no benefit and it doubles the places where things can drift apart. Pick one method per page. Sitemaps suit large sites, HTML tags suit small ones.

Are the codes case sensitive?

No, en-gb and en-GB mean the same thing. The tool writes the usual form anyway, with the language in lower case and the country in capitals, because it's easier to read.

Why does the tool reject es-419?

419 is the UN code for Latin America and it's a valid language tag, but Google's hreflang only accepts two-letter country codes. List the countries you serve, such as es-MX and es-AR, or use plain es.

Are my URLs sent anywhere?

No. The checks and the code are worked out in your browser tab. Nothing you type is sent to our server or saved.

See all FAQs →