Add your language variants below to generate paste-ready HTML <link> tags and XML sitemap alternates for international SEO.
Hreflang tags are <link> elements placed in the <head> of your HTML (or in your XML sitemap) that tell Google and other search engines which language and regional variant of a page should appear for users in different locales. Without them, a search engine seeing near-identical content in British English and American English may treat the pages as duplicates and pick one arbitrarily — often showing the wrong version in a given country's results.
They are an essential part of international SEO for any site serving multiple languages or regions. Implementing them correctly means users in Germany see your German pages, users in the UK see British pricing and spelling, and your translated content earns separate rankings in each market rather than competing with itself.
The most important rule — and the one most often broken — is that hreflang annotations must be reciprocal. Every page in a language set must reference every other page in the set, including itself. If your English page references the French page but the French page does not reference the English page, Google may ignore the whole annotation cluster. This tool generates the complete tag set so you paste the same block into every language variant.
Each language variant must include a tag pointing to itself. Omitting the self-reference is a common mistake that can confuse crawlers. The generated output above always includes a self-referential tag for each URL you enter.
x-default designates the page to show when no locale tag matches the user's location or language preference. Typical candidates are an international home page, a language selector page, or your primary English version. It is optional, but recommended when you have a clear catch-all page. Check the "Include x-default" box to add it using your default URL.
Use ISO 639-1 two-letter language codes combined with optional ISO 3166-1 Alpha-2 region codes, separated by a hyphen. Examples: en (English, any region), en-gb (English, UK), en-us (English, US), de (German), de-at (German, Austria), zh-cn (Chinese Simplified), zh-tw (Chinese Traditional). Google is case-insensitive for these codes, but lower-case is convention.
You can implement hreflang in three ways. The HTML head method — adding <link rel="alternate" hreflang="…" href="…" /> tags — is the most common because most CMS platforms and static site generators can inject them into every page template. The XML sitemap method uses <xhtml:link> elements inside each <url> entry; it is preferable for large sites where adding head tags to every page is impractical. Both methods have equal weight with Google. This tool generates both so you can choose whichever suits your tech stack.
en-uk instead of en-gb, or zh instead of zh-cn / zh-tw, causes the tag to be silently ignored.https://). Relative paths are not valid.An HTML link element or XML sitemap attribute that signals the language and regional variant of a page to search engines, preventing duplicate-content issues and ensuring the right version appears for users in each locale.
Only if you have region-specific variants (e.g. separate pages for US and UK audiences). If you truly have a single page for all language speakers, hreflang is not needed.
Not directly. It does not boost your rankings but it prevents the wrong language version appearing in search results and stops near-duplicate translated pages from competing with each other, which protects your rankings.
Yes — completely free, no sign-up required. All tag generation runs in your browser and nothing is uploaded to a server.