Hreflang Tag Generator
List each language or regional version of a page with its address, plus an x-default. Every code is checked against the standards before the tags are written.
Versions of the page
Codes: a two-letter language (ISO 639-1), optionally a hyphen and a two-letter region (ISO 3166-1), such as fr, en-GB or es-ES. Up to 300 rows.
Everything happens on this page, on your device: nothing you type is sent or saved, and no address is visited or checked online.
Tell search engines which page is for which language
When a page exists in several languages, or in versions for different countries, hreflang annotations tell search engines which version to show to whom, so a visitor in Lyon gets the French page and one in Leeds the British one. They’re easy to get wrong: one mistyped code or a page that doesn’t list the others, and they can be ignored. This tool checks the set, then writes it.
How to use it
- Add a row for each version: its language code and its full address.
- Add an x-default address for everyone else, if you have one.
- Fix anything in red. Each row shows what its code means, so a wrong code stands out.
- Choose link tags, a sitemap or a Link header, then copy or download the result.
What it checks
- Codes against the standards: the language must be one of the ISO 639-1 two-letter codes, and the region one of the ISO 3166-1 country codes. Common mistakes get their own message: en-UK, a country code as the language, an underscore, a three-letter code.
- Look-alikes: uk is Ukrainian and ca is Catalan, so they’re pointed out when used without a region.
- Repeats: each language and region can have only one address.
- Addresses: each must be a full address starting with https:// or http://, as Google requires.
- x-default and generic versions: a missing x-default is flagged, and so is a set like en-US and en-GB with no plain en.
Good to know
- The same block goes on every page. Each version lists all the others and itself, so you never need a different set per page.
- Codes are tidied to the usual style, with the language lowercase and the region in capitals: en-gb becomes en-GB.
- Script codes, as in sr-Latn, are let through but not checked against a list.
- Use each page’s real address, the one in its canonical tag, written the same way on every page, with or without www and a final slash.
- Nothing is checked online. The tool can’t tell whether a page exists or links back; check that on your site.
- Accents in an address? The URL Encoder shows how it’s percent-encoded; the Link header uses that form.