Skip to content
Language URLs → hreflang tagsSEO tools

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.

About this tool

About Hreflang Tag Generator

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.

Hreflang Tag Generator tool

Who needs hreflang

The right page for each reader

English and Hindi sites

Show Hindi readers the Hindi page.

Exampleen for /, hi for /hi/, x-default for /.

Country versions

Same language, different prices or rules.

Exampleen-IN, en-GB and en-US versions of a pricing page.

International shops

Local currency and delivery pages.

Examplees-MX and es-ES product pages with different prices.

Developers

Correct tags for a site template.

ExampleGenerate the tag set to hard-code into a layout.

Hreflang without errors

The rules Google applies

Make it reciprocal

Every version lists all versions, including itself.

Use GB, not UK

Country codes follow ISO 3166: the UK is GB.

Use canonical URLs

Each hreflang URL should be the canonical version of that page.

Canonical Tag Generator

Check in Search Console

International targeting reports show hreflang errors.

Built & tested by

HemantInsights

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

Answers and guidanceFrequently Asked Questions
What is hreflang?
An HTML attribute that tells search engines a page has versions in other languages or for other countries, so the right version is shown to each searcher.
What is x-default?
The version shown to people whose language or country does not match any listed version, often a language selector or the main page.
Why is en-UK wrong?
The ISO country code for the United Kingdom is GB, so the correct tag is en-GB. Google ignores en-UK.
Do I need a tag pointing to the page itself?
Yes. Each version must include the full set of tags, including its own URL.
Can I use only a language without a country?
Yes. hi or en on their own target that language everywhere. Add a country only when versions differ by country.
Does hreflang affect rankings?
It does not boost rankings; it helps Google show the right version to each reader and avoids versions competing as duplicates.
More tools for your workflowRelated Tools

Canonical Tag Generator

Create a clean rel=canonical tag for any page: removes tracking parameters, fixes http and fragments, and gives the HTML tag, HTTP header and Next.js code.

HTML SEO Meta Tag Generator

Generate title, meta description, canonical, Open Graph and X (Twitter) tags with live Google and social previews. Properly escaped HTML, ready to paste.

XML Sitemap Generator

Create an XML sitemap from a list of URLs, a spreadsheet column or a page’s HTML. Duplicates removed, addresses escaped, large sites split automatically.

Robots.txt Generator & Tester

Create a robots.txt file from presets (WordPress, online shop, block AI crawlers), add rules per bot and sitemaps, and test whether any URL is allowed or blocked.

1 / 3
Browse all seo tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.