Create hreflang tags that tell Google which language or country version of a page to show, as HTML, sitemap entries or HTTP headers.

Loading the tool…

What hreflang does

If you have the same page in several languages or for several countries, hreflang tells search engines how the versions relate, so a searcher in Germany sees your German page and a searcher in the UK sees your UK page.

Example

<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Rules that trip people up

Rule Why it matters
Use ISO 639-1 language codes de for German, ja for Japanese (not jp)
Region codes are optional, ISO 3166-1 en-GB is right; en-UK is invalid
Every version lists every version Including itself; missing return links can make Google ignore the tags
Use absolute URLs https://example.com/de/, not /de/
Add x-default The fallback for anyone who doesn’t match a listed language

Which format to use

Use HTML tags for most sites, sitemap entries for large sites where editing every page is hard, and HTTP headers for non-HTML files like PDFs. Pick one method; you don’t need all three.

Frequently asked questions

Is hreflang a ranking factor?

No. It helps Google show the right version, but doesn’t boost rankings.

What is x-default?

The page shown to users whose language or region doesn’t match any of your versions, often a language picker or your main site.

Is it en-GB or en-UK?

en-GB. UK isn’t a valid ISO 3166-1 country code.

Does Bing use hreflang?

Bing mainly uses the content-language meta tag and other signals, but hreflang does no harm.

Sources

Last updated: