Diagnostic tool

Hreflang checker

Enter a URL to read every hreflang annotation on the page, check each language and region code, and fetch the alternate versions to confirm they link back.

Our server fetches the page you enter and up to 10 of its alternate URLs, then passes them back to your browser, where the checks run. Nothing is stored.

How the hreflang checker works

Google reads hreflang annotations from three places: link elements in the HTML head, the HTTP Link response header, and the XML sitemap. This checker fetches the page you enter and reads the first two. For the sitemap method, look for xhtml:link entries in your sitemap file.

Every value is checked against the format Google documents: a language code, then an optional script and an optional region code, or the reserved value x-default. Each URL has to be fully qualified, and HTML link elements have to sit inside the head.

Then the checker fetches up to 10 of the alternate URLs the page names and reads their annotations too. Google says each language version must list itself as well as all other versions, and if two pages do not both point to each other, the tags are ignored. That return link is the check most tools skip.

The hreflang rules at a glance

Each rule below is what Google Search Central's page on localized versions says, and each one maps to a check in the tool.

Language codeISO 639-1, such as en, de or ja. Specifying a region alone is not valid.
Region codeOptional, ISO 3166-1 alpha-2, such as GB or MX. Codes outside the standard, such as es-419, are not supported. EU, UN and UK have no effect.
ScriptOptional, ISO 15924, such as zh-Hant for Traditional Chinese or zh-Hans for Simplified Chinese.
CaseValues are case-insensitive, so en-gb and en-GB mean the same thing.
x-defaultA reserved value for when no other language or region matches the user's browser setting. Designed for language selector pages.
Self-referenceEach version lists itself as well as all the other versions.
Return linksIf page X links to page Y, page Y must link back to page X. Without that, the annotations may be ignored.
URLsFully qualified, with http or https. Not //example.com/foo and not /foo. Alternates do not need to be on the same domain.
PlacementIn HTML, the link elements must be inside a well-formed head section.

Rules checked against Google's documentation: Tell Google about localized versions of your page

What the checker reports

  • Every hreflang annotation on the page, from the HTML head and from the HTTP Link header
  • Language codes that are not ISO 639-1, region codes that are not ISO 3166-1 alpha-2, a region used on its own, and the reserved EU, UN and UK codes
  • Relative or protocol-relative URLs, which Google does not accept
  • A missing self-reference, when no annotation points at the page you checked
  • The same code listed more than once, and link elements placed outside the head
  • For up to 10 alternates: whether each one links back, whether it redirects or returns an error, and whether its set of annotations matches this page's

Hreflang Mistakes That Kill International SEO

The ten mistakes behind almost every broken hreflang setup, with the symptom and the fix for each.

Read the hreflang guide

From the blog

All guides →

Frequently asked questions

What does an hreflang checker test?
It reads the hreflang annotations on a page and checks them against Google's rules: valid ISO 639-1 language and ISO 3166-1 alpha-2 region codes, fully qualified URLs, a self-reference, and return links from every alternate. This one also reports duplicate codes and link elements outside the head.
Is en-UK a valid hreflang value?
No. The region code for the United Kingdom in ISO 3166-1 alpha-2 is GB, so write en-GB. Google names UK, along with EU and UN, as codes that have no effect in hreflang annotations. The language part still counts, but the region part does nothing.
Do I need x-default?
Google does not require it. The reserved x-default value tells Google which page to use when no other language or region matches the user's browser setting. It was designed for language selector pages, but you can use it on any page. The checker notes when it is missing.
Why does the checker fetch the other pages?
Because hreflang only works in pairs. Google says that if two pages do not both point to each other, the tags will be ignored. The only way to confirm that is to open each alternate and read its annotations, so the checker does exactly that for up to 10 of them.
Does hreflang tell Google what language my page is in?
No. Google says it does not use hreflang or the HTML lang attribute to detect a page's language; it uses its own algorithms. hreflang tells Google which other versions of the page exist and who each one is for.