How to Generate Valid Hreflang Tags
Add your language URL variants and copy ready-to-use HTML or XML sitemap code.
- Always include an x-default tag as a fallback for unmatched languages.
- Every language variant should include return links to all other variants and itself.
1. Add Language Codes & URLs
Enter all language variants (e.g., en, hr, de) plus your x-default fallback URL.
2. Copy HTML or XML Sitemap Output
Choose between <link rel='alternate'> tags for <head> or <xhtml:link> for sitemap.xml.
Why Hreflang Matters for International SEO
The most frequent international SEO error is missing return links or forgetting the x-default fallback.
This tool outputs both HTML <head> link tags and XML sitemap <xhtml:link> blocks.
Right Language for Every Market
Users see the localized version of your page in their country's search results.
No Cross-Language Cannibalization
Helps Google distinguish regional variants cleanly.
FAQ
Which language code format should I use?+
Use ISO 639-1 language codes (e.g., en, hr, de) or language-region codes (e.g., en-GB, de-AT).
What is x-default used for?+
x-default specifies the fallback URL for visitors whose browser language doesn't match any explicit hreflang entry.
Do I need hreflang in both HTML and XML sitemaps?+
Either method works cleanly on its own as long as return links are consistent across all language versions.
What is a self-referencing hreflang?+
Each language page must include a hreflang tag pointing to itself in addition to all alternate language versions.