Home › Tools › Technical SEO Tools › Hreflang Tag Generator
Free Technical SEO Tool

Hreflang Tag Generator

List every language and country version of a page and get hreflang code that follows Google's rules. Choose HTML tags, XML sitemap entries or an HTTP header, and add a fallback page for everyone else.

Page Versions

Codes
  • Language is required, country is optional
  • The fallback page becomes the x-default tag for visitors who match no version
  • Pick a country only when content differs by country, such as prices or spelling

Your Hreflang Code


      
Copied!

What Are Hreflang Tags?

Hreflang tags tell Google that several pages are versions of the same content for different languages or countries. Google then shows each searcher the version that fits them best, so a visitor in India sees your English India page while a visitor in Germany sees the German one.

The tags do not change rankings by themselves. They stop the wrong version from showing up, and help Google treat similar pages, like English for India and English for the UK, as a related set instead of duplicates.

How to Use the Hreflang Generator

  1. Add one row per version of the page. Pick the language, and a country only when the content is made for that country.
  2. Paste the full URL of each version, including https://.
  3. Set a fallback page with x-default, such as your main page or a language picker.
  4. Choose a format: HTML tags, XML sitemap entries or an HTTP header.
  5. Add the same code to every version. Each page must list itself and all the others.

Hreflang Rules Google Uses

RuleExample
Language first, in ISO 639 1 formaten, hi, de
Optional country, in ISO 3166 1 formaten-IN, en-GB
A country alone is not allowedin or gb on their own are wrong
Reserved codes do nothingUse en-GB, never en-UK
Optional script for some languageszh-Hans, zh-Hant
Fully qualified URLs onlyhttps://www.example.com/de-de/
Return links are requiredIf A points to B, B must point back to A

These rules come from Google's guide to localized versions of your pages. Google also says region codes like es-419 are not supported, so this generator lists real countries only.

Practical Hreflang Tips

Learn More About International SEO

Start with hreflang tags explained, then make sure every version has the right canonical tag and a clear URL structure. Already live? Test your tags with the hreflang checker.

Frequently Asked Questions

1Do I need a country code in hreflang?

No. A language code alone, like en or hi, is often the best choice. Add a country only when the page is made for that country, for example different prices, currency or spelling.

2What is the x default hreflang value for?

It names the page to show visitors whose language or country matches none of your versions. Many sites use their main English page or a language picker page.

3Should a page include a hreflang tag for itself?

Yes. Google asks every version to list itself as well as all the other versions. The generator builds one shared block that does this for you.

4Can hreflang point to another domain?

Yes. Versions can live on different domains, such as example.in and example.de, as long as every URL is fully qualified and every page links back.

Related Articles

More Free Technical SEO Tools

See all technical seo tools →  |  Browse every free tool →