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
| Rule | Common mistake |
|---|---|
| Valid codes | "en-UK" (should be en-GB), "uk" used for the United Kingdom (it means Ukrainian), country without language ("GB") |
| Self-reference | A page lists its alternates but not itself |
| Return links | Page A points to B, but B doesn't point back, so search engines may ignore the pair |
| Canonical match | hreflang points to a URL that canonicalises or redirects elsewhere |
| One code per URL | The same code used for two different pages |
| x-default | Missing, 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
| Market | Code | Market | Code |
|---|---|---|---|
| English (any region) | en | English, United Kingdom | en-GB |
| English, United States | en-US | English, India | en-IN |
| English, Australia | en-AU | English, Canada | en-CA |
| Hindi, India | hi-IN | Spanish, Spain | es-ES |
| Spanish, Latin America | es-419 | Spanish, Mexico | es-MX |
| French, France | fr-FR | French, Canada | fr-CA |
| German, Germany | de-DE | Portuguese, Brazil | pt-BR |
| Arabic, UAE | ar-AE | Chinese, Simplified | zh-Hans |
| Chinese, Traditional (Taiwan) | zh-Hant-TW | Japanese | ja |
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
| Error | Why it happens | Fix |
|---|---|---|
| Missing return link | Page A lists page B, but B doesn't list A | Put the same complete set on every version |
| Invalid language or region code | Typos, en-UK, or a country code used as a language | Use ISO 639-1 language codes and ISO 3166-1 region codes |
| hreflang to a redirected or 404 URL | URLs changed after a redesign or migration | Update the set to the final, live URLs |
| hreflang on a non-canonical URL | Parameters or duplicates carry the tags | Annotate canonical URLs only, and make each version self-canonical |
| Conflicting methods | Tags in HTML and a different set in the sitemap | Pick 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.

Built by
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
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.