IndexerNow

Hreflang tester

Enter a URL — we extract its hreflang annotations and check for x-default, self-reference, and duplicates.

Common hreflang errors this checker catches

Missing return (reciprocal) links

If your English page points at the French page, the French page must point back. One-way annotations are ignored by Google — reciprocity is the core requirement of hreflang.

Invalid language or region codes

hreflang uses ISO 639-1 language codes plus optional ISO 3166-1 alpha-2 regions. "en-UK" is the classic mistake — the United Kingdom is "en-GB". Invalid codes are silently dropped.

Missing x-default

x-default tells Google which version to serve users who match none of your locales. Without it, mismatched visitors get whichever variant Google guesses.

Missing self-reference

Every page in the cluster should include an hreflang annotation pointing at itself. A missing self-reference weakens the whole cluster's annotations.

Hreflang vs. canonical conflicts

Each hreflang URL must be the canonical version of itself. If a page's canonical points elsewhere while hreflang points at the page, the signals contradict and Google usually ignores the hreflang.

The three ways to implement hreflang

Google accepts hreflang from exactly three places. Use one method per cluster — mixing them is how contradictory annotations sneak in. This checker reads the first two live (HTML head and HTTP header), so you can paste a URL and see exactly what a crawler sees.

1. HTML link tags — the default choice

One <link> per variant in the <head>, including a self-reference and an x-default:

<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

2. HTTP Link header — for PDFs and other non-HTML files

Non-HTML documents have no <head>, so the annotations ride on the response header:

Link: <https://example.com/doc-en.pdf>; rel="alternate"; hreflang="en",
      <https://example.com/doc-fr.pdf>; rel="alternate"; hreflang="fr"

3. Sitemap annotations — for large locale sets

With 10+ locales, per-page link tags bloat every response. Declaring the cluster once per URL in the sitemap keeps pages lean:

<url>
  <loc>https://example.com/en-gb/</loc>
  <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
  <xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>

FAQ

What is hreflang?
hreflang is an HTML annotation (a link rel="alternate" hreflang tag, HTTP header, or sitemap entry) that tells search engines which language and optional region each variant of a page targets — so a searcher in France gets the French page and a searcher in Mexico gets the Spanish one. It's a serving signal for international sites, not a ranking boost.
How do I check hreflang tags online?
Paste the page's URL into the checker above. It fetches the page live, extracts every hreflang annotation from both the HTML head and the HTTP Link header, and flags the common failures: missing x-default, missing self-reference, invalid codes, and duplicate languages. No sign-in needed.
What are the most common hreflang mistakes?
In rough order of frequency: missing return links between variants, invalid codes like en-UK instead of en-GB, no x-default, no self-reference, and hreflang URLs that aren't their own canonical. Any one of these can make Google ignore the annotations for the whole cluster.
Do hreflang errors stop a page from being indexed?
No — hreflang affects which language variant Google serves, not whether pages get indexed. If a page isn't indexing at all, the blocker is elsewhere: check its status, robots rules, and canonical with the indexability checker.
Should hreflang go in the HTML, the HTTP header, or the sitemap?
Pick exactly one method per cluster. HTML link tags are the easiest to maintain and debug for most sites; the HTTP Link header is the only option for non-HTML files like PDFs; sitemap annotations keep large clusters (10+ locales) out of every page's head. Mixing methods on the same pages is a common source of contradictory annotations.
Does this checker fetch the live page?
Yes — it requests the URL you paste and reads what a crawler would actually receive, extracting hreflang from both the rendered HTML head and the HTTP Link header. That catches the cases a copy-pasted-source check misses, like a CDN or middleware stripping tags.

Page not indexing at all? That's not an hreflang problem — run it through the indexability checker to find the real blocker.

Related free tools