Hreflang Checker
Validates hreflang annotations and checks for a self-referencing entry.
What is hreflang?
hreflang is an annotation that tells Google which language or regional version of a page to show each searcher, for example English for the UK and Spanish for Mexico. Each version lists every alternative, including itself, using language codes such as en or en-GB. It only matters for sites that publish the same content in several languages or regions.
How to use the Hreflang Checker
- Enter the URL of one language version of a page.
- The tool reads the hreflang link elements in the HTML and checks each language code.
- It also checks that the page lists itself. Repeat for the other versions to confirm they link back.
How to read the results
- Passed
- Every hreflang value is a valid language (and optional region) code, and the page includes a self-referencing entry.
- Needs attention
- At least one code is invalid (for example en-UK instead of en-GB), or the page does not list itself.
- Not applicable
- The page has no hreflang annotations. That is correct for a single-language site.
How do I write hreflang tags?
Use an ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region code. Add x-default for the page to show when no language matches. Every version must carry the same full set, so that each page links to all the others and they link back.
<link rel="alternate" hreflang="en-GB" href="https://www.example.com/uk/">
<link rel="alternate" hreflang="en-US" href="https://www.example.com/us/">
<link rel="alternate" hreflang="es-MX" href="https://www.example.com/mx/">
<link rel="alternate" hreflang="x-default" href="https://www.example.com/">export const metadata = {
alternates: {
canonical: 'https://www.example.com/uk/',
languages: {
'en-GB': 'https://www.example.com/uk/',
'en-US': 'https://www.example.com/us/',
'x-default': 'https://www.example.com/',
},
},
};Common hreflang mistakes
Missing return links (page A lists B but B does not list A), using country codes as language codes (such as “uk” for Ukrainian is fine, but not for the United Kingdom), pointing hreflang at redirected or noindexed URLs, and mixing hreflang with a canonical that points to a different language version.
Frequently asked questions
Do I need hreflang for a single-language site?
No. hreflang only helps when you have equivalent pages in more than one language or region.
HTML tags, HTTP headers or sitemap?
Google supports all three and treats them the same. Sitemaps are easiest to maintain on large sites; HTTP headers suit PDFs and other non-HTML files.
Does this tool check return links?
It checks the page you enter. To confirm return links, run it on each language version and compare the lists.
Sources
What this tool checks
hreflang annotations valid
When hreflang link elements are present, checks their language values are well-formed and that a self-referential entry exists.
Why it matters: hreflang tells search engines about alternate language/region versions of a page. Malformed values are ignored, and a missing self-reference is a common mistake.
If it fails: Use valid ISO language (and optional region) codes, include a self-referencing hreflang, and keep the set consistent across all versions.
Source: developers.google.com/search/docs/specialty/international/localized-versions
Related tools
- Identity Schema CheckerLooks for Organization or Person markup naming who is behind the site.
- Local Business Schema CheckerChecks for LocalBusiness structured data on pages that look local.
- Open Graph Tags CheckerChecks Open Graph tags are present and og:image is an absolute URL.
- Schema.org CheckerDetects Schema.org structured data and validates every JSON-LD block.
- Social Media Links CheckerLooks for links to your Facebook, X, Instagram, LinkedIn and YouTube profiles.
- X (Twitter) Cards CheckerChecks for X Card tags that control how the page looks when shared on X.
Reviewed by Prabath Thalangama · Last updated