Hreflang Tag Generator
Generate correct hreflang link tags for multilingual and multi-regional websites. Outputs HTML link tags, HTTP header format, and XML sitemap format — with x-default support.
Frequently Asked Questions
What is hreflang and why do I need it?
Hreflang is an HTML attribute that specifies the language and geographic region a webpage targets. It tells Google which version to show based on user language and location. Without hreflang, Google may show your English (US) page to visitors in India who prefer the English (IN) version, or display English content to Malayalam-speaking users. Hreflang is essential for any site with content in multiple languages or targeting multiple countries with region-specific variations.
What language code should I use for India?
For English content targeting India, use "en-IN". For Malayalam, use "ml" or "ml-IN". For Hindi targeting India, use "hi-IN". For Tamil in India, use "ta-IN". Language codes follow the BCP 47 standard: a two-letter ISO 639-1 language code optionally followed by a hyphen and a two-letter ISO 3166-1 country code. The country code is optional — use it only when you have separate content specifically for users in that country.
What is the x-default hreflang tag?
The x-default value is a fallback that tells Google which page to serve when no other hreflang value matches a visitor's language or region. For example, if you have pages for en-US and en-IN but a visitor from Australia arrives, Google will serve the x-default URL. It is also used to point to a language-selector page. Without x-default, Google must guess which version to show to unmatched visitors, which can lead to incorrect language targeting and a poor user experience.