NEW!

Hreflang Checker

Validate hreflang clusters in your browser. Find missing return tags, invalid ISO codes, missing x-default, and duplicate locales. Browser-only, no upload.

100% Private & Secure

All processing happens locally in your browser. Your files never leave your device.

Client-Side Processing No Server Uploads No Registration Required
Examples
Validation options
Drop a sitemap.xml file or click to browse

All processing happens locally in your browser. Sitemap data and URLs never leave your device.

Keywords

hreflang checkerhreflang validatorhreflang tagsinternational seo auditreturn tag checkx-defaultiso 639-1 localemultilingual seo

Need something else?

How to use

1

Choose an input mode: Sitemap XML (when your hreflang is declared via xhtml:link annotations inside a sitemap), HTML head (when you have raw HTML from one page), or URL map (a JSON-lines structure when you scripted the extraction yourself).

2

Paste the content into the input area, or drop a .xml or .html file onto the upload zone. For the HTML mode, also fill in the source URL so the checker knows which page the annotations belong to.

3

Open Validation options to tune behavior. By default x-default missing is reported as a warning; toggle Require x-default to make it a hard error. Trailing-slash and protocol differences are normalized so a /en and a /en/ in the same cluster do not look like two URLs.

4

Click Check hreflang. The tool builds clusters from every alternate link, then validates each cluster for bidirectional return tags, locale code validity, x-default presence, duplicate locales, and self-reference.

5

Read the Findings tab for per-URL issues sorted by severity, and the Clusters tab for a per-cluster summary with locales, x-default status, and bidirectionality. Export findings as CSV for issue tracking, or the full report as JSON for downstream pipelines.

Features

Three Input Modes, One Validation Engine

Paste a multilingual sitemap with xhtml:link annotations, paste a single HTML head with link rel="alternate" tags, or feed a JSON-lines URL map you generated yourself. All three modes feed the same validator so results are consistent.

Bidirectional Return-Tag Check

The single most common hreflang mistake is a URL that points to its siblings without those siblings pointing back. The checker walks every cluster and flags exactly which return tag is missing — not just that the cluster is broken.

ISO 639-1 and ISO 3166-1 Validation

Each locale is parsed against the ISO 639-1 language code and ISO 3166-1 alpha-2 region patterns. Common mistakes like en-USA, en-UK, or unstandardized values such as 'english' or 'br' are flagged with the exact offending value.

x-default Presence Check

Google strongly recommends declaring an x-default for international targeting. Missing x-default is reported as a warning by default, escalated to an error when Require x-default is enabled in the validation options.

Findings + Cluster Views with Exports

Two complementary views: a per-finding severity table you can sort and export to CSV for issue trackers, and a per-cluster summary with locale chips, x-default badge, and bidirectional badge. Export the full structured report as JSON for downstream automation.

Why Choose This Tool?

Your Sitemaps Never Leave the Browser

Multilingual sitemaps often expose staging URLs, country gating, or pre-launch locale rollouts that you cannot upload to a third-party SaaS service. The hreflang checker runs entirely in your browser tab — no upload, no API call, no logs. You can verify this in DevTools by watching the network panel during a check.

Tells You Which Tag Is Missing, Not Just That The Cluster Is Broken

Most validators say 'cluster broken' and leave you to find the missing return tag manually. This checker walks every pair in the cluster and reports the exact source URL and the exact sibling that is not declared, so the error becomes a one-line fix instead of an investigation.

Sitemap and HTML Modes Share One Validator

Whether your hreflang declarations live in xhtml:link annotations inside the sitemap or in link rel="alternate" tags inside the page head, the parser surfaces the same HreflangEntry shape and the same validation engine runs on top. You do not need to learn two tools for two delivery methods.

Open-Source Validation Logic

The validation runs from the @anthropic-tools/tools-core library. The same parser and rules ship in the REST API. You can audit the locale validation, return-tag walk, and x-default check directly in the source — no black-box scoring, no closed rules.

Hreflang Tags Explained: A Practical Guide for Multilingual Sites

What hreflang Actually Does

Hreflang is a declaration from your site to search engines saying, "this URL is the version of this page for users searching in language X (and optionally country Y)." Google does not use hreflang as a ranking signal directly — it uses it as a routing signal. When a Spanish-speaking user in Mexico searches for one of your pages, Google decides which of your URLs to surface in their SERP partly by reading your hreflang cluster. If the cluster is wrong, the wrong URL shows up; if the cluster is broken, Google may fall back to its own language detection, which is often worse than what you declared.

The mechanics are simple. Each URL declares a list of "alternate" siblings: same content, different audience. Each alternate is annotated with an hreflang attribute that names the audience by ISO 639-1 language code, optionally suffixed with an ISO 3166-1 region code. An optional x-default alternate handles the "everyone else" case. The cluster has to be bidirectional and the locale codes have to be standards-compliant for Google to trust the signal.

Where Hreflang Lives

There are three valid places to declare hreflang. First, in the HTML head as <link rel="alternate" hreflang="..." href="...">. Second, in the HTTP response headers via Link: <...>; rel="alternate"; hreflang="...". Third, in the XML sitemap as <xhtml:link rel="alternate" hreflang="..." href="..."/> elements inside each <url> entry. All three are equivalent for Google. Most CMS-driven sites use the HTML head approach because the per-page metadata is easier to template; large enterprise sites often use the sitemap approach because it concentrates all of the international declarations in one place that can be regenerated from a CMS export.

The Five Cluster-Level Mistakes

Most hreflang failures fall into one of five categories: missing return tags, missing self-references, invalid locale codes, duplicate locales, and missing x-default. The checker reports each of these as a distinct finding code so they can be triaged independently.

  • Missing return tag (MISSING_RETURN_TAG): URL A declares URL B as an alternate, but URL B does not declare A. Google requires the relationship to be bidirectional — without the return, the entire cluster is silently dropped.
  • Missing self-reference (MISSING_SELF_REFERENCE): URL A's hreflang block must include itself as an alternate. This is the rule most often violated by CMS templating bugs that emit the "other languages" list but forget to add the current one.
  • Invalid locale (INVALID_LOCALE): Values like en-USA, en-UK, br (instead of pt-BR), or english fail validation. Google rejects the malformed entry and may drop the entire cluster if too many entries are bad.
  • Duplicate locale (DUPLICATE_LOCALE): Two alternates within the same source URL claim the same locale but point to different URLs. The checker flags this with both target URLs so the conflict can be resolved.
  • Missing x-default (MISSING_X_DEFAULT): Strictly optional, but strongly recommended. Without an x-default Google has no fallback for users whose locale does not match any of your declarations. Reported as a warning by default, error when Require x-default is enabled.

Locale Code Standards

The language portion uses ISO 639-1 (two letters) or ISO 639-2 (three letters when no two-letter code exists). Examples: en, es, zh, fil. The optional region portion uses ISO 3166-1 alpha-2 (two letters, conventionally uppercase). Examples: en-US, es-MX, zh-CN. The separator is a hyphen, not an underscore. Common mistakes the checker catches: en_US (wrong separator), en-USA (three-letter region), en-UK (UK is not an ISO 3166-1 code — Great Britain is GB), and language-only entries with invalid codes like english or br.

x-default: The Fallback You Should Almost Always Declare

The x-default alternate tells Google, "if the user's locale does not match any of my explicit alternates, send them here." For most sites, the x-default points to the global landing page (often the English version, or an unbranded language picker). Without an x-default, Google has to guess. The guess is usually wrong, and the cost is sending Spanish-speaking visitors to the German URL because the German URL had the highest authority. The checker reports a missing x-default as a warning by default because some single-locale clusters legitimately do not need one, but for any cluster with three or more locales, x-default is effectively required.

Cluster Bidirectionality: The Most Expensive Mistake

The bidirectionality rule is the single most common cause of hreflang clusters being silently ignored by Google. The rule is exact: for every URL A in a cluster of size N, A must declare all N URLs (including itself) as alternates. If A declares B, but B does not declare A, the relationship is broken and Google may drop the entire cluster. The checker walks every cluster pair-by-pair and reports the exact missing return tag — not "cluster broken" but "URL A's hreflang block is missing a return tag pointing to URL B." That precision turns a vague Search Console "international targeting issue" warning into a one-line CMS fix.

Where Hreflang Auditing Fits In The Bigger SEO Picture

A clean hreflang cluster does not guarantee good international rankings — it guarantees that Google routes users to the URL you intended. The strongest international SEO programs combine: (a) a working hreflang cluster validated by a tool like this; (b) market-specific content rather than machine-translated boilerplate; (c) country-targeted Search Console properties so per-market performance can be tracked; (d) explicit canonicalization so duplicate-content rules do not collapse the cluster; (e) backlink profiles from local sources to establish topical authority in each market. The hreflang check is the cheapest 80% of that audit and the easiest one to run before any deploy.

Privacy: Why Local Validation Matters Here

Multilingual sitemap files routinely include URLs for staging environments, market-specific pre-launches, and gated content for specific countries. Uploading those to a third-party validator means those URLs end up in someone else's logs. This checker runs entirely in your browser tab — the XML or HTML never leaves the page. You can verify in DevTools that clicking Check triggers zero outbound requests. The same validation library is available open-source if you want to run it in CI; the web tool itself is fully self-contained.

Frequently Asked Questions

Is my sitemap or HTML data sent to a server?

No. Parsing and validation run entirely in your browser tab using JavaScript loaded from a static site. You can confirm this in your browser's network panel — clicking Check triggers no outbound requests.

Which hreflang declarations are supported?

All three Google-supported delivery methods: HTML head link tags, xhtml:link annotations inside an XML sitemap, and a generic URL-to-annotations JSON map for when you have already extracted the data yourself. HTTP Link response headers are not yet supported because the browser cannot inspect them across origins.

What ISO codes are accepted?

Language codes follow ISO 639-1 (two letters) and ISO 639-2 (three letters where no two-letter code exists). Region codes follow ISO 3166-1 alpha-2 (two letters). Common mistakes like en-USA, en-UK, or underscore separators are flagged. The literal value x-default is recognized as a sentinel and exempted from locale validation.

Why is missing x-default only a warning by default?

Single-locale clusters and tightly-scoped two-locale clusters can legitimately work without x-default. For broader clusters with three or more locales, x-default is effectively required — toggle Require x-default in the validation options to escalate it from warning to error.

How are trailing slashes and protocol differences handled?

By default the checker normalizes both sides: trailing slashes on non-root paths and the http vs https protocol distinction are ignored when matching cluster members. This prevents false 'missing return tag' errors when one part of your CMS emits a trailing slash and another part does not. Turn off the toggles in Validation options if you specifically need to compare those dimensions.

What happens if the cluster references a URL I did not provide?

The checker emits a warning of type MISSING_ANNOTATIONS_FOR_URL identifying the URL that was referenced but not supplied. The cluster still appears in the results but its bidirectional flag is false because the missing URL's declarations cannot be verified.

Can I export the results?

Yes. The Findings tab has CSV and JSON export buttons. The CSV is suitable for issue trackers or spreadsheets and lists one row per finding with severity, code, URL, hreflang value, related URL, and message. The JSON export contains the entire structured report including all clusters and stats, suitable for downstream automation.

Does the checker support self-canonical and noindex conflicts?

Not yet. Those checks belong to a separate canonical/robots auditing layer. This tool focuses on hreflang correctness in isolation; pairing it with the upcoming canonical-tag auditor gives you the full international SEO picture.

Learn more