List each language version of a page and get a correct, reciprocal set of hreflang tags to paste into all of them. The builder validates language and region codes, catches the common mistakes, and also outputs the XML sitemap version.
One row per language version of the same page. Use a language code (hi) or language and region (en-IN). Mark one as the default for visitors who match none.
What hreflang does
When the same page exists in several languages, hreflang tells search engines which version is for whom. A reader searching in Hindi gets the Hindi page, a reader in Marathi gets the Marathi one, and the versions are understood as translations of each other instead of competing as duplicates.
It is also one of the most frequently broken pieces of markup on the web, because it has to be right on every page at once. One missing line can cancel the whole set.
The rule that breaks most setups
Hreflang must be reciprocal. If the English page says “my Hindi version is over there”, the Hindi page must say “my English version is back there”. When the return link is missing, search engines ignore both. Every version must also include a line pointing at itself.
That is why the builder gives you one block for all versions. You paste the same lines into the head of every page in the group, and reciprocity follows automatically.
Getting the codes right
| Code | Meaning | Notes |
|---|---|---|
hi |
Hindi, any country | Language alone is valid and often enough |
hi-IN |
Hindi, for India | Language first, then country |
en-GB |
English, for the United Kingdom | The country code is GB. en-UK is invalid and silently ignored |
en-IN |
English, for India | Use when you also have another English version, such as en-US |
x-default |
Everyone else | The fallback for visitors who match no listed version |
The language part is an ISO 639-1 code: hi, mr, ta, bn, gu, te, kn. The region part is an ISO 3166-1 country code. You cannot use a region without a language, and you cannot target a state or city. The builder rejects invalid codes, corrects UK to GB, and stops you assigning one code to two URLs.
Three ways to add hreflang
- HTML link tags in the head of each page. Simple, visible, and what this tool outputs first.
- XML sitemap entries. Better for large sites because the pages stay lighter. The tool outputs this too.
- HTTP headers. Needed only for files that are not HTML, such as PDFs.
Choose one. Google treats the three as equivalent, and running two at once doubles the places a mistake can hide.
Before you paste
- Every URL must be absolute, starting with
https://. - Every URL must return 200. Hreflang pointing at a redirect or a 404 is ignored.
- Each page’s canonical tag must point at itself, not at the English version. A Hindi page that canonicalises to English is telling search engines to drop it.
- The content must really be in the language declared.
What this tool cannot tell you
It builds the tags for one group of pages at a time and checks the codes and the URL format. It does not crawl your site, so it cannot confirm the URLs are live, that the canonicals are right, or that the tags are present on every page afterwards. For a site with many translated pages, generate the tags from your CMS so they cannot drift apart.
Frequently asked questions
Do I need hreflang if I only have English?
No. A single version needs none.
Which version should be x-default?
The one you want shown to someone whose language you do not cover. For most Indian businesses that is the English page.
Does hreflang improve rankings?
Not directly. It makes sure the right version is shown, which improves the experience and stops your own translations competing with one another.