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
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.
List every version of the page
One row per language and country you serve, each with its full URL.
Add an x-default
Point it to the page visitors should get when none of your versions match them.
Pick the format
HTML tags for most sites; sitemap entries for large sites where editing every page is hard; HTTP headers for PDFs.
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.
OpenHreflang Questions
What is an hreflang tag?
Do I need hreflang for one language in several countries?
Is it en-uk or en-gb?
What does x-default mean?
Should hreflang go in the HTML or the sitemap?
Does each page need a self-referencing hreflang tag?
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