hreflang Tags Generator
Automatically generate accurate "hreflang tags" (HTML/XML) essential for multilingual SEO.
Includes x-default settings and duplicate error checking.
Output Format
Default URL to display for unmatched languages
🌐 Language, Region, and URL Settings
✨ Generated Code
About This Tool
This browser-based tool accurately and efficiently generates "hreflang tags" which are essential for multilingual website SEO optimization. Simply input your corresponding languages and URLs to instantly output HTML header tags or XML sitemap code.
All processing is safely done on your device, and your input data is never sent to a server. It saves you the trouble of manual coding and prevents human errors or duplicate configurations.
How to Use
Set format & x-default
Select output format (HTML/XML) and input a fallback "x-default" URL if needed.
Register languages
Add language codes, regions, and their corresponding version URLs using the add button.
Code generation
It instantly checks for conflicts and auto-generates the code at the bottom of the screen.
Copy & Implement
Click the copy button and paste the code into your target pages or XML sitemap.
Glossary
- hreflang attribute
- An HTML attribute used to tell search engines that "an alternative version of this page exists for a specific language/region". It helps serve the correct language version in search results.
- x-default
- A special value specifying the fallback URL to display by default when there is no page matching the user's language or region settings.
- ISO 639-1 (Language Code)
- The 2-letter language code specified in hreflang attributes (e.g., ja for Japanese, en for English). You must use valid ISO standard codes.
- ISO 3166-1 alpha-2 (Region Code)
- A 2-letter code used in combination with a language to specify a country/region (e.g., US for United States). It should always follow the "language-region" format (e.g., en-US).
- XML Sitemap
- A file that informs search engines of URLs on a website. You can write hreflang tags using <xhtml:link> elements within an XML Sitemap instead of placing them in HTML headers.
FAQ
- Q.Do I only need to put hreflang tags on one of the language pages?
- No, you must set them as "reciprocal links" on all target pages. For example, if you have an English page and a Japanese page, the HTML of BOTH pages must contain hreflang tags linking to both versions.
- Q.Should I use HTML output or XML output?
- If you can easily edit the HTML <head> of your pages directly, the HTML format is common. If your site has a massive number of pages making HTML header updates difficult, or if you want to centralize SEO management, using the XML Sitemap format is recommended.
- Q.Do I have to set the "x-default" value?
- It is not strictly required, but highly recommended. By specifying a global fallback page to show when a user accesses with a language outside your supported list, you prevent a poor user experience.
- Q.Can I specify just a language code without a region code?
- Yes, it works perfectly. If your target is "English speakers worldwide" regardless of country, just use "en". If your target is strictly US users, use "en-US".
Use Cases
Launching Multilingual Corporate Sites
When adding foreign language versions to a company site, this prevents search engines from mistaking them as duplicate content and correctly routes global users to their respective pages.
Global E-commerce SEO
Even for the same language (like English), if separate pages exist with different pricing/shipping for the US, UK, or Australia, properly specifying regions via hreflang prevents search mismatches.
Sitemap Management for Large Media
For media sites operating thousands of multilingual articles, it’s helpful for generating XML sitemap codes to notify search engines of reciprocal links without directly editing HTML files.
Send Feedback
Please let us know your thoughts to help us improve the tool.
Feedback is temporarily suspended
The server is busy or spam protection is active. Please try again later.