hreflang checker
Paste hreflang annotations (HTML, HTTP headers or sitemap) and get precise errors, warnings and a corrected snippet.
Runs in your browser. Nothing is uploaded.
Tool
This tool checks only what you paste. It never fetches URLs, so return links are checked among the pages you paste here.
Results
Paste annotations to see results.
Rules
Every finding names its rule. Google rules only; Bing and other engines are not covered.
invalid-code
error · From Google guidance
The value is not x-default or a valid language, optional script and optional region. Google supports ISO 639-1 languages and ISO 3166-1 alpha-2 regions only.
common-mistake
error · From Google guidance
Known wrong forms: en-UK (use en-GB), jp (use ja), underscores (en_US), a region without a language, and the reserved EU and UN regions.
case-convention
info · From Google guidance
Values are case-insensitive. Convention is lowercase language, title-case script, uppercase region.
relative-url
error · From Google guidance
The href must be fully qualified, including http or https.
duplicate-code
error · From Google guidance
The same code is listed more than once with different URLs.
duplicate-url
warning · Consistency check
One URL is listed for several codes. Allowed, but check it is intended.
missing-self
error · From Google guidance
Each language version must list itself as well as the others, so the page's own URL must be in its set.
missing-return
error · From Google guidance
If two pages don't both point to each other, the tags are ignored. Checked among the pasted pages only.
no-x-default
info · From Google guidance
No x-default entry. Recommended as a fallback for unmatched languages, not required.
mixed-protocol-host
warning · Consistency check
URLs in one set mix http and https, or a bare host and its www version. Usually unintended; not a Google requirement.
trailing-slash-mismatch
warning · Consistency check
An annotation differs from the page's URL only by a trailing slash, so the page does not list itself exactly.
canonical-mismatch
warning · Consistency check
The page's own hreflang URL differs from its declared canonical. Check that the canonical and the hreflang URLs agree.
lang-mismatch
warning · Consistency check
<html lang> differs from the language of the self-referencing hreflang. Google does not use the lang attribute to detect language, so this is a consistency check.
Examples
<link rel="alternate" hreflang="en-UK" href="https://example.com/en/" /> <link rel="alternate" hreflang="jp" href="/ja/" /> <link rel="alternate" hreflang="de_DE" href="https://example.com/de/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr-ca/" />
<link rel="alternate" hreflang="en" href="https://example.com/en/" /> <link rel="alternate" hreflang="de" href="https://example.com/de/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />
What this can't check
- It does not fetch URLs or crawl, so it cannot tell whether a URL exists, redirects or is indexable.
- Return links are checked only among the pages you paste, not against the live site.
- It applies Google's rules only. Other search engines may differ.
- Rules marked "Consistency check" are sensible checks, not requirements stated by Google.
- Language and region validity relies on your browser's Intl data, restricted to the code forms Google supports.