ClicksBracket

Free Hreflang Tag Generator

Tell Google which language and country each version of a page is for. Get the tags as HTML, sitemap entries or HTTP headers, checked for the usual mistakes.

  • 72 languages, 70 countries
  • HTML, sitemap or HTTP header
  • Free, runs in your browser

Versions of the page

Every version must list all the others and itself. Google: localized versions of your pages

Your hreflang code

Add the URL of each version to build the tags.

Paste the tags into the head of every version of the page.

Expanding into the UK, Canada or Australia? See our SEO services

How Hreflang Works

Hreflang tells Google that several pages are versions of the same content for different languages or countries, so each searcher sees the right one.

Language code
Two letters from ISO 639-1: en, es, fr, de. Required on every tag. Google: localized versions
Country code
Optional, two letters from ISO 3166-1 after the language: en-US, en-GB, es-MX. The United Kingdom is GB, not UK.
x-default
The page for everyone you do not target, often your main or language-picker page.
Return tags
Every version must list every other version and itself. If the UK page points to the US page but not back, Google ignores the pair.
Where to put it
In the head of each page, in your XML sitemap, or as an HTTP header for PDFs. Pick one method per site and stick to it.

How to Set Up Hreflang

Get the set right once, then copy it to every version.

  1. List every version of the page

    One row per language and country you serve, each with its full URL.

  2. Add an x-default

    Point it to the page visitors should get when none of your versions match them.

  3. Pick the format

    HTML tags for most sites; sitemap entries for large sites where editing every page is hard; HTTP headers for PDFs.

  4. Put the same set on every version

    Every version carries the full list, including itself. Then check Search Console for hreflang errors after a few weeks.

When You Want It Done for You

Tags tell Google which page is for whom. These win the searches in each market.

SEO services

The 90-Day Lead Engine: rank higher in 90 days or less, or we work free until you do.

Open

Web design

A website that turns visitors into customers, live in 14 days.

Open

Digital marketing services

SEO, ads and maps run as one plan, so every channel brings leads.

Open

Hreflang Questions

What is an hreflang tag?
An HTML attribute that tells Google which language, and optionally which country, a page is for, and where its other versions are. Google uses it to show a searcher in London the UK page and a searcher in Texas the US page.
Do I need hreflang for one language in several countries?
Yes, if the pages differ by country, such as prices in dollars and pounds or different spellings. Use en-US, en-GB and en-AU so Google does not treat them as duplicates.
Is it en-uk or en-gb?
en-GB. Country codes follow ISO 3166-1, where the United Kingdom is GB. en-uk is invalid and Google ignores it.
What does x-default mean?
The fallback version for visitors whose language or country none of your versions targets. It is optional but recommended.
Should hreflang go in the HTML or the sitemap?
Either works; Google treats them the same. Tags in the head are simplest for small sites. Sitemap entries are easier for large sites with many versions, because you edit one file instead of every page.
Does each page need a self-referencing hreflang tag?
Yes. Every version lists itself as well as all the others. The generator's output already includes each version, so paste the same set on every page.

Want a Person to Look at Your Site?

Free tools fix pages one at a time. Book a free 30-minute SEO review: we look at your site and Search Console together and tell you what we would fix first.

  • The quick wins on your busiest pages
  • The keywords closest to page one
  • Whether your tracking counts the leads you already get
  • An honest answer on whether you need us at all

Book your free SEO review

We reply within one working day.

No contract, no sales pressure. The findings are yours either way.