Free tool · Technical SEO

Hreflang Checker & Tag Generator

Validate a page's hreflang set (codes, self-reference, x-default, return links and canonicals), or generate correct hreflang tags for your language and country versions.

By Ajay Padhy · Updated · Free, no sign-up

Disclaimer

The checker reads hreflang from the page's HTML and HTTP headers, not from XML sitemaps, and fetches up to 15 alternate pages. Search engines treat hreflang as a hint, not a directive, so correct tags don't guarantee which version ranks in each country.

Privacy: URLs you check are fetched once to produce the result and aren't stored.

How to use the hreflang checker

  • Check a page: enter a URL. The tool reads its hreflang tags (HTML and HTTP Link headers), validates every code, then visits each alternate to confirm it loads, links back and isn't canonicalised elsewhere.
  • Generate tags: list each language or country version with its URL, choose an x-default, and copy the tags for every page in the set.

The hreflang rules that break most often

RuleCommon mistake
Valid codes"en-UK" (should be en-GB), "uk" used for the United Kingdom (it means Ukrainian), country without language ("GB")
Self-referenceA page lists its alternates but not itself
Return linksPage A points to B, but B doesn't point back, so search engines may ignore the pair
Canonical matchhreflang points to a URL that canonicalises or redirects elsewhere
One code per URLThe same code used for two different pages
x-defaultMissing, so users outside your targets get a random version

Choosing language and region codes

Use ISO 639-1 language codes (en, hi, de, es), optionally followed by an ISO 3166-1 region code (en-GB, en-IN, es-MX). Use a region only when the content really differs by country (currency, pricing, delivery, legal terms). For a single English version serving everyone, you may not need hreflang at all.

Where to put hreflang

  • HTML head: <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/"> on every version
  • HTTP headers: for PDFs and other non-HTML files
  • XML sitemap: good for large sites. Use one method consistently rather than mixing.

My guide to international SEO keyword research explains when separate regional pages are worth it, and international and enterprise SEO is where I set this up across markets.

Common hreflang codes

MarketCodeMarketCode
English (any region)enEnglish, United Kingdomen-GB
English, United Statesen-USEnglish, Indiaen-IN
English, Australiaen-AUEnglish, Canadaen-CA
Hindi, Indiahi-INSpanish, Spaines-ES
Spanish, Latin Americaes-419Spanish, Mexicoes-MX
French, Francefr-FRFrench, Canadafr-CA
German, Germanyde-DEPortuguese, Brazilpt-BR
Arabic, UAEar-AEChinese, Simplifiedzh-Hans
Chinese, Traditional (Taiwan)zh-Hant-TWJapaneseja

The language always comes first. en-UK is invalid (use en-GB), and region-only codes such as IN or US don't work on their own.

hreflang errors and how to fix them

ErrorWhy it happensFix
Missing return linkPage A lists page B, but B doesn't list APut the same complete set on every version
Invalid language or region codeTypos, en-UK, or a country code used as a languageUse ISO 639-1 language codes and ISO 3166-1 region codes
hreflang to a redirected or 404 URLURLs changed after a redesign or migrationUpdate the set to the final, live URLs
hreflang on a non-canonical URLParameters or duplicates carry the tagsAnnotate canonical URLs only, and make each version self-canonical
Conflicting methodsTags in HTML and a different set in the sitemapPick one method per page and keep it consistent

FAQ

Hreflang Checker & Tag Generator: common questions

Short answers to what people ask most about this tool and topic.

No. It helps search engines show the right language or regional version to the right users. It doesn't make a page rank higher.

Every page that has an alternate version should carry the full set, including itself. Pages without alternates don't need hreflang.

It names the page to show users whose language or region matches none of your hreflang values, often a language selector or your main international version.

Bing primarily uses the content-language meta tag and other signals, and treats hreflang as a weaker hint. Use both if Bing matters to you.

Ajay Padhy

Built by

Ajay Padhy

SEO and AI search (GEO) consultant with 14+ years in digital growth. I build these tools for the checks I run on client sites every week. Need more than a quick check? See my international SEO or get in touch.

Found this useful? Link to it

If you mention the hreflang checker & tag generator in a guide, checklist or resource list, you can copy this link:

<a href="https://ajaypadhy.com/tools/hreflang-checker">Hreflang Checker & Tag Generator</a>

More free tools

All free SEO & AI search tools →

Have a growth problem worth solving?

Tell me where you're stuck. On a 30-minute intro call I'll tell you where I think the constraint is and what I'd look at first — whether or not we end up working together.