GALAXY OF TOOLS

SEO SECTOR

Hreflang Validator

Validate hreflang in HTML, HTTP headers or sitemaps: codes, self-reference, x-default and return links.

The page and its HTTP headers are fetched, then each alternate page so its return links can be checked.

Hreflang tag generator

Every version must carry the same complete set. For a whole head section use the Meta Tag Generator.
HTML <head> tags
HTTP Link header (PDFs and other files)
XML sitemap

Only addresses are sent: the page you enter (with its response headers) and each alternate URL it lists are fetched by this site’s server on Cloudflare, without cookies or logins. Pasted HTML and sitemaps, and the generator, stay in your browser.

A hreflang validator that checks both directions

This hreflang validator reads the language and regional alternates a page declares — in <link rel="alternate" hreflang> tags, in the HTTP Link: header, or in an XML sitemap with xhtml:link entries — and checks them the way Google’s documentation describes: valid codes, fully qualified URLs, a self-reference, an x-default, no duplicate codes, a canonical that agrees, and tags in the right place.

Most hreflang sets fail on return links: page A lists page B, but B never lists A, so Google ignores the pair. Enter an address and the validator fetches each alternate page to confirm it links back, then shows the whole set as a grid. A generator below writes a clean set for HTML, HTTP headers and sitemaps.

How to validate hreflang tags

  1. Enter the Page address of one language version, or choose Paste HTML and paste a page’s source or a sitemap fragment.
  2. Leave Check return links ticked to fetch up to 20 alternate pages, four at a time.
  3. Press Validate hreflang and read the prioritised list: invalid codes and missing return links come first.
  4. Check the Annotations table (with a readable name for each code) and the Return links grid.
  5. In the Hreflang tag generator, press Use the set above — invalid codes such as en-UK are replaced by their fix — and copy the format you need.

Hreflang Validator features

Three sources

HTML link tags, the HTTP Link header (read from the page’s response) and sitemap xhtml:link entries, with a warning when HTML and header disagree.

Code checks from the browser

Tags are parsed and canonicalised with the browser’s built-in locale data (Intl), which is current in modern browsers, plus rules Google states: two-letter language codes, two-letter regions, no region on its own, x-default allowed.

Return-link grid

Every fetched alternate is shown with whether it links back and whether it lists each version with the same URL, including slash-only differences.

Canonical conflicts

Flags a canonical that points away from the page, alternates that redirect, answer an error or are canonicalised elsewhere.

Generator

Writes the same set as HTML tags, one HTTP Link header and a sitemap with a <url> entry per version.

Worked example: a set with three typical faults

Show the example checks a British English page that lists en-GB (itself), en-US, de-DE, fr and es-419, with all four alternates answered from built-in copies. The validator reports:

FindingWhy
es-419 is invalidGoogle supports two-letter ISO 3166-1 regions only; numeric regions such as 419 are ignored
de-DE has no return linkThe German page lists itself and en-US, but not the British page
fr calls this page “en”Different codes for the same page across the set — keep one set
No x-defaultVisitors in other languages have no fallback page
en-GB and en-US but no plain enOptional: a language-only tag catches English speakers elsewhere

The rules Google applies

Google’s guide to localized versions (last updated 21 September 2026) sets the rules this tool checks. The first code is an ISO 639-1 language, optionally followed by an ISO 3166-1 Alpha 2 region; a script can be given with ISO 15924, as in zh-Hant. Other codes, such as es-419, aren’t supported, a country code can’t be used by itself, and values such as EU, UN or UK have no effect — the United Kingdom is GB, so British English is en-GB. Each version must list itself and every other version; alternate URLs must be fully qualified with http or https; and the link tags must sit inside a well-formed <head>.

Codes are validated with the browser’s own locale data rather than a list copied into this page, so readable names such as “Brazilian Portuguese” for pt-BR come from the same source. Old codes the browser replaces (for example a withdrawn language code) are reported as “update” with the current form.

Fetch limits and what isn’t checked

  • One check uses one page fetch for your page, one header check and one page fetch per alternate (up to 20). This site’s server allows each visitor 60 page fetches and 120 status checks per 10 minutes; if the limit is reached, the alternates already checked are kept and the message says when to try again.
  • Pasted HTML and sitemaps are analysed without any request, so return links can only be checked within the pasted sitemap.
  • Hreflang added by JavaScript is not seen. For a full sitemap check use the XML Sitemap Validator; for other head tags the Meta Tag Analyzer.

Hreflang Validator FAQ

What does a hreflang validator check?

This hreflang validator checks that every code is a valid language (and optional region), that URLs are complete, that the page lists itself, that there is an x-default, that no code points to two URLs, and that every alternate links back.

Is en-UK a valid hreflang code?

No. UK is not the ISO code for the United Kingdom, so Google ignores it. Use en-GB.

What is x-default?

A reserved value naming the page for visitors whose language or region matches none of your tags — often a language chooser or your main international page. It is optional but recommended.

Why does Google ignore my hreflang tags?

Usually because of missing return links: if page A lists page B but B doesn’t list A, the pair is ignored. Invalid codes, relative URLs, tags outside the head and canonicals pointing to another language are the other common causes.

Can I put hreflang in the HTTP header or sitemap instead?

Yes. Google accepts HTML tags, the Link header (useful for PDFs) or sitemap xhtml:link entries; use one method consistently. The generator writes all three.

Do I need hreflang for one language in several countries?

Only if the versions differ, for example prices or spelling for en-GB and en-US. Each version still needs the complete set, including itself.

You might also need