Fix the common hreflang mistakes
Invalid codes, missing return links, non-indexable alternates, no self-reference and no x-default, with fixes.
Hreflang errorsFree SEO tool · Google hreflang rules
Build a complete hreflang set for every language version of a page, as HTML tags, an HTTP Link header or XML sitemap entries. Or paste the annotations you already have and see what Google would ignore.
Type a value to see whether Google accepts it and which language and region it means.
Generator
Add one row per language or regional version of the page. Every version must carry the same full list, including itself, so the output is the same for all of them.
Shown to users whose language matches none of the versions: usually a language selector or your main version.
Put these lines in the <head> of every version listed, before any element that does not belong in the head.
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="fr-CA" href="https://example.com/fr-ca/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Validator
Paste a page's HTML source (or just its link tags), an HTTP Link header, or an XML sitemap. The format is detected; a sitemap is checked for return links between its entries.
| Line | hreflang | Language | URL | Status |
|---|
| Sitemap <loc> | Alternates | Issues |
|---|
How it works
The generator follows these rules and the validator checks them, from Google's guide to localized versions of a page.
| Three methods | HTML <link> tags, an HTTP Link header or an XML sitemap. Google treats them as equivalent; using more than one gives no benefit in Search. |
|---|---|
| Codes | An ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region: de, de-AT. A script can sit between them, as in zh-Hant-TW. Values are case-insensitive. |
| Invalid regions | A region can't be used on its own, so GB alone is invalid. UK, EU and UN have no effect; the United Kingdom is GB. |
| Complete sets | Each language version must list itself as well as every other version, so the same set appears on all of them. |
| Return links | If two pages don't both point to each other, Google ignores the annotations between them. |
| Full URLs | Alternate URLs must be fully qualified, with https://. They can be on different domains. |
| x-default | The reserved value for users whose language or region matches none of the versions. It takes no language code. |
| Placement | HTML tags must be inside a well-formed <head>. Google stops reading the head at the first element that is not valid there, such as an <img> or <div>. |
Sources: Tell Google about localized versions of your page and valid page metadata (Google Search Central).
Next step
Valid tags on one page are a start. These guides cover the rest of the set and the site around it.
Invalid codes, missing return links, non-indexable alternates, no self-reference and no x-default, with fixes.
Hreflang errorsChoose a URL structure, connect equivalent pages and keep each locale indexable.
Technical international SEOMap every old locale URL to its new equivalent and update the whole set with the redirects.
International URL mappingGood to know
Source: Google Search Central.
List every language or regional version of the page with its code and full URL, add an x-default if you have a fallback page, and copy the output. Put the same set on every version listed, because each one must list all versions, including itself.
Google treats the three methods as equivalent, so use the one your site can keep up to date. HTML tags suit most pages, HTTP headers suit PDFs and other non-HTML files, and a sitemap keeps large sets out of the page head. Using more than one method gives no extra benefit.
No. Region codes follow ISO 3166-1 alpha-2, where the United Kingdom is GB, and Google says UK, EU and UN have no effect in hreflang. Use en-GB instead.
Yes. Google requires fully qualified alternate URLs including the protocol, such as https://example.com/de/. A relative path like /de/ is not valid.
Yes, if you paste an XML sitemap that contains all the versions: each entry is checked against the others. From a single page's HTML, the tool can only check that page's own set; checking return links across a site needs every page crawled.
Crawlens reads the hreflang tags on every crawled page and flags invalid codes, missing return links, alternates that aren't indexable, and sets without a self-reference or x-default.
Download free for Windows