Hreflang Generator
Generate hreflang tags for multilingual and multi-regional websites
Add each language/region version of your page. Include a URL for every language, including the current page. Google recommends including an x-default for international users.
Privacy First
All tag generation happens locally in your browser. No URLs or data are sent to any server. Your website information remains completely private.
About Hreflang Tags
Hreflang tags tell search engines which language and regional version of a page to show to users based on their location and language preferences. This is essential for multilingual websites and websites targeting different countries.
When to Use Hreflang
- Your site has content in multiple languages
- You have regional variations of the same language (en-US vs en-GB)
- You have country-specific content (different prices, products, etc.)
- You want to prevent duplicate content issues across language versions
Hreflang Format
The hreflang value uses ISO 639-1 language codes, optionally combined with ISO 3166-1 Alpha-2 country codes:
en- English (any region)en-US- English for US usersen-GB- English for UK usersde- German (any region)de-AT- German for Austriax-default- Fallback for unmatched users
Implementation Methods
There are three ways to implement hreflang:
1. HTML Link Elements
<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="es" href="https://example.com/es/page" />
<link rel="alternate" hreflang="x-default" href="https://example.com/page" /> 2. XML Sitemap
<url>
<loc>https://example.com/en/page</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<xhtml:link rel="alternate" hreflang="es" href="https://example.com/es/page" />
</url> 3. HTTP Headers
Link: <https://example.com/en/page>; rel="alternate"; hreflang="en",
<https://example.com/es/page>; rel="alternate"; hreflang="es" Important Rules
- Hreflang must be reciprocal - each page must link to all versions including itself
- Use absolute URLs, not relative paths
- All linked pages must return 200 status codes
- Use consistent URL format across all versions
- Include x-default for a catchall fallback
- Don't use hreflang for content that's only slightly different
Related Utilities
Explore our other free tools: JSON Formatter, Base64 Encoder, Password Generator, UUID Generator, and QR Code Generator.