Hreflang Tag Generator
Create hreflang link tags for multilingual and multi-country sites, with x-default, and catch invalid language and country codes such as en-UK.
Create hreflang link tags for multilingual and multi-country sites, with x-default, and catch invalid language and country codes such as en-UK.
About this tool
Hreflang Tag Generator creates the rel="alternate" hreflang link tags that tell Google which version of a page to show to people in each language or country. Add a row for every version of the page, with its full URL and its language code, optionally followed by a country: en for English, hi for Hindi, en-IN for English for India, en-GB for the United Kingdom, es-MX for Spanish in Mexico, or zh-Hans for Simplified Chinese. Choose which URL is the x-default, the version shown to everyone who does not match any listed language, usually your language-selector or main English page. The tags update as you type. The generator also checks for the mistakes that most often make Google ignore hreflang: codes that are not valid, the country code UK instead of GB (en-UK is one of the most common hreflang errors), codes written country-first such as in-en instead of en-IN, the same language listed twice, and relative URLs where full https:// addresses are required. Hreflang only works when it is reciprocal: every version must carry the same complete set of tags, including one pointing to itself, because if page A lists page B but page B does not list page A, search engines ignore the pair. Paste the tags into the head section of every version, or put the same information in your XML sitemap or HTTP headers. Each URL should also be the canonical version of its page, because hreflang pointing at a redirected or non-canonical URL is ignored. Everything runs in your browser.

Its full URL and language (and country) code.
The page for everyone else.
Invalid codes, duplicates and relative URLs.
The same full set on each language page.
Catches en-UK, reversed codes and invalid tags.
A fallback for unmatched visitors.
Handles zh-Hans and zh-Hant-TW correctly.
Each language listed once.
Explains the reciprocal-link rule.
Runs in your browser.
The right page for each reader
Show Hindi readers the Hindi page.
Exampleen for /, hi for /hi/, x-default for /.
Same language, different prices or rules.
Exampleen-IN, en-GB and en-US versions of a pricing page.
Local currency and delivery pages.
Examplees-MX and es-ES product pages with different prices.
Correct tags for a site template.
ExampleGenerate the tag set to hard-code into a layout.
The rules Google applies
Every version lists all versions, including itself.
Country codes follow ISO 3166: the UK is GB.
Each hreflang URL should be the canonical version of that page.
Canonical Tag GeneratorInternational targeting reports show hreflang errors.
Senior Software Engineer · Developer of Toolyconvert
Hemant developed Hreflang Tag Generator and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.
Last updated 24 November 2026
Featured on
Toolyconvert is listed on these product directories and launch platforms.