Skip to main content
Yoryantra
← Back to Tools

Hreflang Validator

Validate hreflang tags for language codes, region codes, x-default, duplicate targets, absolute URLs, and self-reference.

Paste HTML link tags, sitemap XML with alternate links, or simple lines like en-US https://example.com/us/.

Options

Checks hreflang values, language and region shape, x-default, duplicate targets, absolute URLs, and self-reference when a current page URL is provided.

Output

Hreflang validation output will appear here.
Parsing and validation run in this page. The code does not send pasted hreflang markup or URLs to a validation API.

Hreflang is a cluster, not a tag-by-tag setting

International pages work as a connected alternate set. Every localized version should list itself and the other versions, and the alternate URLs must be fully qualified. A clean-looking tag on one page can still fail when another page in the cluster does not return the relationship.

The pasted set is checked for locale syntax, duplicate locale targets, absolute URLs, x-default, and self-reference when you provide the current page URL. Reciprocal links on remote pages are deliberately outside the browser-only check because confirming them requires fetching those pages.

Locale codes need the right shape

Google supports ISO 639-1 language codes, optional ISO 3166-1 Alpha-2 regions, and ISO 15924 scripts such as zh-Hant. A script can also be followed by a region, for example zh-Hans-US. Reserved region labels such as UK are not treated as GB.

x-default is a fallback, not a mandatory locale

x-default is recommended when a fallback or language-selector URL makes sense. Its absence is therefore a review note by default rather than a hard failure.

Before publishing a locale cluster

  1. Paste the HTML alternate links, sitemap XML, or locale-and-URL lines.
  2. Enter the current page URL when you want a local self-reference check.
  3. Resolve invalid locale codes, missing alternate relationships, relative URLs, and duplicate locale assignments.
  4. Visit or crawl the alternate pages separately to confirm return links.
  5. Keep the same cluster consistent across every localized version.

What the pasted markup can and cannot prove

Visible here

Locale syntax, x-default, duplicate locale assignments, duplicate destinations, fully qualified URLs, and self-reference against the URL you enter.

Needs a crawler or live-page check

Return links, HTTP status, canonical behavior, indexability, redirects, and whether the alternate page actually contains the intended localized content.

Google's current hreflang rules

Google documents HTML, HTTP headers, and XML sitemaps as equivalent ways to declare localized versions. It also requires each language version to list itself and the other versions. The source of truth for these Google-specific checks is the localized versions documentation.

Hreflang decisions that often cause mistakes

Should every locale include itself?

Yes for Google's implementation guidance. Each version should list itself along with the other alternate versions.

Can alternate pages live on different domains?

Yes. The relationship is not restricted to one host, but each alternate URL still needs to be fully qualified.

Does a valid pasted set confirm reciprocal links?

No. The remote pages are not fetched, so return links must be checked separately.

Is x-default always required?

No. It is a recommended fallback for unmatched languages, especially on selector or global fallback pages.