# Hreflang Checker

> Validate hreflang tags on any page: language and region code format, x-default, self-reference, duplicates, Link headers and return links on alternates.

Use it free at https://swipetolaunch.com/tools/hreflang-checker

## How to use it

1. **Paste a URL.** One language version of a page that has translations or regional variants.
2. **Validate.** We read hreflang link tags and Link headers, check every code, then fetch up to 12 alternates to confirm they link back.
3. **Fix errors.** Invalid codes, missing self-references and missing return links are listed with the fix.

## What hreflang is for

If a page exists in more than one language or for more than one region, hreflang tells search engines which version to show to which searcher. Without it, a Spanish searcher may get your English page, or your UK and US pages may compete with each other as duplicates.

Each version lists all the versions, including itself:

```
<link rel="alternate" hreflang="en-us" 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="x-default" href="https://example.com/" />
```

## The rules this checker enforces

- **Valid codes.** A two-letter ISO 639-1 language code, optionally followed by an ISO 3166-1 region: `en`, `en-gb`, `pt-br`, `es-419`. A script subtag like `zh-Hant` is allowed. Underscores (`en_US`) and `en-uk` are the most common mistakes; the UK code is `gb`.
- **Self-reference.** The page must list itself with its own code.
- **One URL per code.** The same language code pointing at two URLs is a conflict.
- **x-default.** Optional but recommended: the fallback for visitors who match none of your languages, often a language picker or the main site.
- **Return links.** Hreflang must be reciprocal. If page A lists page B, page B must list page A, or Google ignores the pair. We fetch up to 12 alternates to confirm.
- **Absolute URLs.** Relative hrefs are flagged.

## Three places to declare hreflang

In HTML link tags (checked here), in the HTTP Link header (also checked here, and the only option for PDFs), or in the XML sitemap. Use one method consistently. For sitemaps, the [sitemap checker](/tools/sitemap-checker) is the right tool.

Hreflang works alongside canonicals, not instead of them. Each language version should have a self-referencing canonical; check that with the [canonical URL checker](/tools/canonical-url-checker).

## What you get

- ISO 639-1 language and ISO 3166-1 region validation
- x-default, self-reference and duplicate checks
- Reads HTML tags and HTTP Link headers
- Confirms return links on up to 12 alternates

## Questions

### Is it en-uk or en-gb?

en-gb. The ISO 3166-1 code for the United Kingdom is GB. en-uk is invalid and Google ignores it.

### Do I need x-default?

It is optional. Add it when you have a sensible fallback for visitors whose language or region you do not target, such as an international English page or a language picker.

### Why does Google ignore my hreflang tags?

The most common reasons are missing return links (page B does not list page A), invalid codes, a missing self-reference, or alternates that redirect, return errors or carry a canonical pointing elsewhere.

### Is hreflang case-sensitive?

No. en-GB and en-gb are treated the same. Lowercase language with uppercase region is the conventional style.

### Does hreflang help rankings?

It does not raise rankings by itself. It makes sure the right language version is the one that ranks in each market, which improves clicks and stops your own versions competing.
