Hreflang tag generator for every language version of a page.
Add a row for each language or regional version of a page and copy the hreflang tags, ready for the head of every version or for your XML sitemap. Nothing you type leaves your browser.
The page for visitors whose language or country matches none of the above, often a language picker.
Language: two letters (ISO 639-1), such as en or fr. Region: optional, two letters (ISO 3166-1), such as US or GB, not UK.
Every version must carry the full set, itself included, or the links won’t count. Check a live page with our hreflang checker.
About this tool
What it makes
Each row takes a language, an optional region and the page’s full address, and you can add an x-default for searchers who match none of them. We produce the link tags to paste into the head of each version, and the same set as sitemap entries using xhtml:link.
How to use it
Every version must carry the full set, including a link to itself. Google ignores hreflang between two pages unless both point to each other, so paste the same block into each version. Use full addresses that start with https://, as Google requires fully qualified URLs.
HTML or sitemap
Google treats hreflang in the HTML, in HTTP headers and in sitemaps as equivalent, and says using more than one method brings no benefit in Search. Pick the one that’s easiest to keep up to date. A sitemap keeps the tags out of your pages, which some site owners find simpler to manage.
Questions
Languages in ISO 639-1 format, such as en or fr, optionally followed by a region in ISO 3166-1 Alpha 2 format, such as en-CA or fr-CA. Google doesn’t support codes outside those standards.
No. Google’s own example uses one generic English page for searchers in every English-speaking country without a page of their own. Add regional versions only when the content differs, such as prices, spelling or contact details.
Run one of the pages through our hreflang checker. It reads the tags, loads each alternate and confirms they link back to each other.
More free tools
- Hreflang checkerFree hreflang checker: validate language and region codes, x-default and self-links, and check each alternate page links back to yours.
- XML sitemap checkerFree XML sitemap checker: find and validate your sitemap or sitemap index, check its URLs and lastmod dates, and test that listed pages answer 200.
- All free toolsCheckers for your site and generators for robots.txt, llms.txt and schema.
Find out where you rank today.
Send us your website and we will reply with a free audit: what is holding you back and what we would fix first.
Get my free audit