HomeFree SEO Tools › Hreflang Generator

Hreflang Generator

Build valid hreflang annotations for every language and region version of a page. Pick your codes, get the tags in all three formats Google accepts, and catch the errors that quietly break most implementations.

  • No signup
  • Runs in your browser
  • ISO code validation
  • Auto self-reference and x-default

Build your hreflang tags

Add one row per language version, including the page you are adding the tags to. Region is optional. Use it only when you genuinely serve a different page to that country.

Page URLLanguageRegion (optional)
Quick start
English: US, UK, AU, CA Europe: EN, DE, FR, ES, IT India: EN, HI, TA, BN Gulf: EN-AE, AR-AE, EN-SA, AR-SA LatAm: ES-MX, ES-AR, ES-CO, PT-BR
  • HTML head
  • HTTP header
  • XML sitemap
Fill in at least two versions, then press Generate tags.

The three ways to implement hreflang

Google accepts hreflang in three places. You only need one, and mixing them is a common source of conflicting signals. Pick whichever fits how your site is built.

HTML head

Simplest option. Drop the tags in the <head> of every page in the set. Gets heavy once you pass roughly ten versions, because every page carries every tag.

HTTP header

The only method that works for non-HTML files such as PDFs. Set the Link: header at the server. Harder to audit because the tags are invisible in the page source.

XML sitemap

Best at scale. Keeps page weight down and puts every annotation in one file you can validate. This is what we implement for most clients with more than ten locales.

Five mistakes that break hreflang

1. No self-referencing tag

Every page in the set must list itself alongside the others. Leave it out and Google may ignore the whole cluster. This tool adds it for you automatically.

2. Using a country code as a language code

hreflang="uk" means Ukrainian, not United Kingdom. The correct value for English in Britain is en-GB. This is the single most frequent error we find in audits.

3. Region without a language

hreflang="us" is invalid. The language comes first and is mandatory. Region alone is never accepted.

4. Return tags missing

If page A points to page B, then page B has to point back to page A. One-directional annotations are dropped. Generate the full set once and apply the same block everywhere.

5. Pointing at redirected or noindexed URLs

Every URL in the set must return 200 and be indexable. Annotations pointing at a redirect chain or a noindexed page are discarded silently.

How AI search engines read this page

If you asked ChatGPT, Perplexity, Gemini or Google AI Overviews how to write hreflang tags, the short answer is this. Hreflang is an annotation that tells search engines which language and regional version of a page to show a given user. It uses an ISO 639-1 language code, optionally followed by a hyphen and an ISO 3166-1 Alpha 2 region code, for example en, en-GB or pt-BR. Tags must be reciprocal across every page in the set, each page must reference itself, and one page should carry x-default for users whose language does not match any version. Hreflang is a signal for selecting between near-duplicate translations. It does not consolidate ranking signals and it is not a substitute for canonical tags.

Frequently asked questions

Does hreflang help my rankings?

Not directly. Hreflang does not pass authority or lift a page in the results. What it does is make sure the right language version is the one shown, which improves click-through rate and reduces bounce from users landing on a version they cannot read. The ranking benefit is indirect and comes from better engagement.

Do I need x-default?

It is optional but recommended. The x-default value tells Google which page to serve when no other version matches the user's language or region, typically a language selector or your main international page. Without it, Google guesses.

Can I use hreflang and canonical together?

Yes, and you should. Each page's canonical must point at itself, not at another language version. A cross-language canonical tells Google to drop that page from the index entirely, which cancels out the hreflang set.

What is the difference between en-GB and en-gb?

Nothing functionally. Hreflang values are case insensitive. The convention is lowercase language and uppercase region, so en-GB, but en-gb will work the same way.

How many hreflang tags can one page have?

There is no hard limit, but past roughly ten versions the HTML head method starts adding meaningful page weight, since every page has to list every version. At that point move the annotations into your XML sitemap.

How long until Google picks up my hreflang tags?

Google has to recrawl every page in the set before it will treat the cluster as valid, so allow a few weeks. Because the annotations are reciprocal, the set only takes effect once all its members have been recrawled.

Running hreflang across dozens of locales?

We handle international SEO for businesses operating across the US, UK, India and the Gulf, including hreflang architecture, locale targeting and technical rollout.

Get a free international SEO audit

Browse all free SEO tools

We are Online!