Hreflang Validator – Fix Your Multilingual Tags

Validate hreflang annotations from HTML, XML or a live URL. Detect invalid codes, duplicates, missing return links, x-default problems and canonical conflicts — with a visual language map of every annotation.

25+SEO Tools
100%Free
0Signup Required

Hreflang Validator

Paste tags, XML or a URL — the tool checks every annotation for format, duplication, reciprocity and x-default problems.

Plain "lang URL" lines also work, e.g. en-US https://example.com/en/. Analyzed 100% locally.

Quick Answer

A hreflang validator reads the language annotations on your pages and checks them for the mistakes that silently break multilingual SEO: invalid language codes, duplicate or missing annotations, pages that never link back, and x-default configured wrongly. This tool does it from pasted HTML, XML or a live URL — and draws your language map so the structure is obvious at a glance.

How to Use the Validator

  1. Pick an input — paste the alternate-link tags or full HTML, paste an XML sitemap snippet, or fetch a page URL.
  2. Click "Validate Hreflang" — every annotation is checked and the language map renders.
  3. Fix in priority order — invalid codes and missing return links first, then duplicates, then x-default consistency.

What This Tool Checks

  • Language code format — ISO 639-1 (2–3 letters) with an optional ISO 3166-1 region (2 uppercase letters).
  • Duplicate annotations — the same language/URL pair appearing twice.
  • Multiple URLs per language — two pages claiming the same language version.
  • Self-references / return links — every referenced URL must annotate itself, or the set is not bidirectional.
  • x-default consistency — a single fallback URL shared across the set.
  • Canonical conflicts — the page canonical should be part of the hreflang set.
  • Language/path mismatch — a URL slug that contradicts the declared language.

The Golden Rules of Hreflang

  • Use absolute URLs. Relative URLs break hreflang; search engines need the full address.
  • Every page links to every version, including itself. A self-referencing tag is mandatory.
  • Keep the annotation set identical on every page. If page A lists 4 languages, page B must list the same 4.
  • Use the same URL as canonical and in the hreflang set. Conflicts confuse the picker.
  • Use one URL per language-region pair. Never map two URLs to "en-US".

Example: A Three-Language Set

An English page at /en/ carries tags for en-US (itself), hi-IN (/hi/) and fr-FR (/fr/), plus x-default pointing at /en/. The validator confirms each URL self-references and every pair returns the link. The structure renders as en-US → /en/ · hi-IN → /hi/ · fr-FR → /fr/ · x-default → /en/ — clean and correct.

Common Mistakes & How to Avoid Them

  • Typing "en-us" in lowercase. Regions must be uppercase; the validator flags it as malformed.
  • Forgetting the self-reference. The English page must tag itself as en-US, not just list the other languages.
  • Using different sets per page. Missing return links mean search engines distrust the whole cluster.
  • Copy-pasting a stale URL. A path that contradicts the language code is a classic paste error.

Frequently Asked Questions

What does x-default actually do?

It tells search engines which URL to show when a searcher's language or region is not covered by any of your language versions. It is not a language and never gets a region code.

Can hreflang be set in the sitemap instead of HTML?

Yes — xhtml:link elements in an XML sitemap are supported by Google and Bing, and this tool validates that format too.

Does hreflang handle en-US vs en-GB properly?

Yes, but only if you actually serve different content for each region. If the content is identical, a single en version plus x-default is simpler and safer.

Is this tool an official Google validator?

No. It is an independent, rule-based checker. For final confirmation, use Google's own URL Inspection tool in Search Console.

Related SEO Tools

Pair hreflang fixes with the Canonical URL Checker (canonical conflicts are a top hreflang breaker), verify the URLs in your XML Sitemap Analyzer, and confirm the pages resolve with the HTTP Status Code Checker.

FAQ

Hreflang Validator FAQ

Quick answers to common questions

Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show to which users — for example en-US versus en-GB versus hi-IN versions of the same content.

The most common failures are invalid language codes, missing self-referencing tags, annotations that point to pages which do not link back, duplicate language mappings, and x-default mistakes. This tool checks all of them.

Enter the page URL and the tool fetches it (when the browser permits), parses the alternate links and validates the annotation set. If fetching fails due to CORS, paste the HTML from view-source instead.

x-default identifies the fallback page shown to users whose language or region you do not serve — usually your primary language homepage. Every language version should reference it.

No. Validation runs entirely in your browser. URL fetching may use a public CORS relay if a direct request is blocked, but pasted input never leaves your device.

One Language Set, One Source of Truth

Validate the annotations, then make sure every URL in the set resolves cleanly.