Tool
Hreflang planner
Enter each language version of one page with its address, and the planner writes the full hreflang set to place on every version, plus the same set as sitemap entries. It checks the codes against your browser's language and region data, flags duplicates, UK instead of GB, and regional versions without a language-only fallback. Everything runs in your browser.
Build the hreflang set
The planner needs JavaScript to build the tags. With it switched off, the steps further down this page describe each rule it applies, so you can write the set by hand.
Link elements for the head of every version
Add your versions and choose Build the tags.
The same set as sitemap entries
How to use it
- Enter one row for each version of the page: a two-letter language code, an optional two-letter region, and the full address of that version. The planner starts with a German, French, Italian and English example you can overwrite.
- Add an x-default address if you have a language chooser page or a version to offer when nothing else matches.
- Choose Build the tags. Read any messages above the results first; red ones must be fixed before the set is usable.
- Copy the link elements into the head of every version listed, or use the sitemap form instead. Do not use both for the same pages.
- Save the result as a text file if you want to send it to a developer.
What it checks
| Check | Why |
|---|---|
| Language is two letters and recognised | Google expects ISO 639-1 language codes 1 |
| Region, if given, is a recognised two-letter code | Google expects ISO 3166-1 alpha-2 regions 1 |
| UK is rejected in favour of GB | UK is not an ISO 3166-1 code; GB is the code for the United Kingdom |
| Groupings such as EU are rejected | They are not countries, so they are not ISO 3166-1 alpha-2 regions |
| Each address is complete and uses https | Annotations should use full addresses; the planner accepts only https:// |
| No code appears twice | One code can point to one address only |
| Shared addresses are flagged | Allowed, but worth checking that one page suits both audiences |
| Regional versions have a general fallback | A reader of that language elsewhere matches nothing otherwise |
| At least two versions exist | Hreflang describes alternatives |
Recognition uses the language and region names built into your browser. If your browser lacks that data, the planner falls back to checking the format only.
What it does not check
The planner works only with what you type. It does not visit your pages, so it cannot tell whether the annotations are actually published, whether every version carries the same set, whether the addresses answer without redirects, or whether canonical tags point at the right page. Those checks need the live site; our hreflang guide explains how to do them by hand.
Why the set is identical on every version
Google's documentation requires every version to name itself and all its siblings, and it disregards a pair whose pages fail to reference each other 1. That is why the planner produces one block for all versions instead of a different block per page: the same lines go everywhere, including the line for the page itself.
Reading the sitemap output
The sitemap form repeats the full set inside each version's url entry. The urlset element at the top of your sitemap must declare the XHTML namespace, which the first comment line of the output reminds you about. If your platform generates sitemaps automatically, check whether it can add these entries before writing them by hand.
Swiss examples
For a site with German, French and Italian versions aimed at Switzerland and an English version for everyone, the codes would be de-CH, fr-CH, it-CH and en. If your German version serves German readers everywhere, plain de is simpler and follows the W3C advice to keep tags as short as the context allows 2. Romansh uses rm.
Privacy
Nothing you enter leaves your browser. The page makes no requests with your data and stores nothing after you close it.
Sources
Want the published tags on your live site looked at?
Send us the address and the languages, and we'll reply by email on whether we can help.
Ask about your site