Hreflang tag generator
Every version,
listing every other.
A hreflang tag generator writes the lines that tell Google a page exists in several languages or for several regions, one line per version, each with its language code and full address. List your versions on the right and copy the result as HTML link tags, an HTTP Link header or an XML sitemap. Each code and address is checked against what Google’s page says.
It runs in your browser and nothing you type is sent to us. It cannot open your pages, so it cannot check that the live ones link back: what that rule means and how to check it is further down.
By the Builderify team
One line per version: its code, a space, then its full address. Add a line starting x-default for the fallback.
Put these lines in the head of every one of the versions. The same set goes on all of them.
- i Put this same set on every version of the page. Google's page says each version must list itself and all the others, and that if two pages do not point to each other the tags may be ignored. This tool cannot open your pages, so it cannot check the live ones.
Already have hreflang tags? Paste them to check them
Language first,
then the region.
A hreflang value is a language code from ISO 639-1, optionally followed by a region code from ISO 3166-1 alpha-2, joined by a dash. The language can stand alone; the region cannot, and codes outside those two lists are not supported.
Case does not matter to Google, but the ISO convention is a lowercase language and a capital region, which is how the generator writes it. Google also says it does not use hreflang, or the HTML lang attribute, to work out what language a page is in: it does that with its own algorithms, so a wrong code does not change how the page is understood, only which versions are offered to whom.
- de
- Valid
- German, for everyone, whatever their region
- en-GB
- Valid
- English, for users in the UK
- de-ES
- Valid
- German, for users in Spain
- zh-TW
- Valid
- Chinese for users in Taiwan; Google derives the Traditional script from the country
- zh-Hant
- Valid
- Chinese in the Traditional script, any region
- zh-Hans-US
- Valid
- Chinese in the Simplified script, for users in the United States
- be
- Not valid
- Not Belgium: be is the language Belarusian. Belgium is de-BE, nl-BE or fr-BE
- es-419
- Not valid
- Not supported: 419 is not an ISO 3166-1 alpha-2 region
- en-UK
- Not valid
- The region UK has no effect, and so do EU and UN. The UK is GB
- US
- Not valid
- Not valid on its own: the first code is the language, so write en-US
From the “Supported language and region codes” and “Common mistakes” sections of Google’s page. The generator accepts only the 184 two-letter ISO 639-1 languages and the 249 assigned ISO 3166-1 alpha-2 regions, and for scripts it knows only Hans and Hant, the two the page names.
Three places,
pick one.
Google says the three methods are equivalent from its side, and that using all of them at once brings no benefit in Search and makes the set harder to keep correct. Choose the one that is easiest for your site to maintain.
The generator writes all three from the same lines, so switching method later means copying a different tab. Addresses are written out in full in each one, with & escaped as & in HTML and XML.
In the head of every version of the page: one link element for each version, the page itself included, and the same set on every version. Google's page says the tags must be inside a well-formed <head>, and that hreflang should not be mixed into one link tag with other attributes such as media.
For files with no head, such as PDFs. The server returns one Link: header that lists every version with its address in angle brackets, the requested version included, and the header is identical for every version.
One <url> for each address, each with an xhtml:link child for every version, itself included, and the xmlns:xhtml namespace declared. Google says these child elements do not count towards the sitemap's URL limit.
From the “Methods for indicating your alternate pages”, HTML, HTTP header and sitemap sections of Google’s page.
If page X points to Y,
Y must point back.
This is the mistake Google lists first. A tag is only trusted when both pages name each other, and the easy way to guarantee that is to put the same complete set on every version.
Each version lists itself
Google's page says each language version must list itself as well as all the others. A set that names only the other pages leaves a gap on every page. The generator's output already includes the page itself.
The set is the same everywhere
For the HTML and header methods Google says the set of links is identical for every version. That is why one generated block can be pasted into all the pages, or one template can print it.
A one-way tag may be ignored
If two pages do not both point to each other, Google says the tags will be ignored. It gives the reason: otherwise someone on another site could name your page as an alternative version of theirs.
Incomplete sets
Google says that if complete two-way links become hard to maintain you can leave some languages out on some pages, and it will still process the ones that point to each other. New language pages should link both ways with your main language first.
What this tool cannot see
It never opens your pages, so it cannot confirm that the live tags match. It checks what you give it: a generated set, or tags you paste in. Paste a whole sitemap and it does check the return links inside that file.
Checking by hand
Open each version, view its source and search for hreflang. The lines should be the same on every page, one per version with the page itself among them. A tag that is missing on one page is the one Google ignores.
From the “Guidelines for all methods” and “Common mistakes” sections of Google’s page. The last two cards are this page’s own advice, not Google’s.
What the generator
looks for.
Each finding says which line it is about and whether the line was left out of the result. A rule marked Ours is this tool’s own advice: Google’s page does not say it, so treat it as a suggestion.
| Looks at | What it finds | Whose rule |
|---|---|---|
| Code | A language that is not two letters, or not in ISO 639-1 | |
| Code | A country with no language in front of it, and be and uk, which are languages | |
| Code | A region that is a number, is EU, UN or UK, or is not an assigned ISO 3166-1 code | |
| Code | An underscore where a dash belongs, an empty part, too many parts | Ours |
| Code | Case tidied, and a script other than Hans or Hant that this tool cannot verify | |
| Address | Not fully qualified: starts with // or /, has no http or https, no host name | |
| Address | A space or quote that would break the tag, and a # fragment | Ours |
| Set | The same code listed twice | Ours |
| Set | The same address under two codes | Ours |
| Set | Fewer than two versions | |
| Set | No x-default | |
| Set | Several regions of one language and no plain version of it | |
| Set | A mix of http and https | Ours |
| Set | A reminder that every version must carry the full set |
A line with an error is left out of the result, because writing it would produce a tag Google ignores or misreads. The lists of languages and regions are not ISO’s own publication: they were taken from the ICU data in PHP 8.4 on 24 November 2026, minus its historic and reserved entries.
When you need to
write them yourself.
This generator is for pages you publish yourself, in separate language or region versions. It is also a way to see what a correct set looks like: the preset called “A real set from this site” is the one this site prints on its translated Meta Pixel guide.
Every Builderify page that has a translation prints one link per version, itself included, plus an x-default that points at the English page. The same block is on each version, which is the pattern above.
With the plugin's SEO translations switched on, each language gets its own address, such as /fr/about/, sent already translated by your server, with hreflang links and sitemap entries. In that setup the plugin writes the tags, so you do not need this tool.
Translations are applied in the visitor's browser, with no separate address per language and no hreflang, so search engines see your original pages. There is nothing to tag unless you publish language versions yourself, for example as copies you translate.
The first row is how this site’s own pages are built (read in the code and in the live page source on 24 November 2026). The other two are the product facts in the GTranslate alternatives guide and the Spanish translation guide.
Builderify’s Translations module covers the other half, translating the text visitors read. The cost of each route is in the website translation cost guide, and Builderify is free to start, with 250 free credits a month and no monthly fee: see pricing.
Start freeHreflang tags, before you ask.
It is a line that tells Google a page has other versions for other languages or regions. Each tag names one version with a code, such as de or en-GB, and its full address. You can write the same information as link elements in the page's head, as an HTTP Link header, or as xhtml:link entries in an XML sitemap. Google's page says the three methods are equivalent.
Yes. Google says each language version must list itself as well as all the other versions, and that for the HTML and header methods the set of links is identical on every version. That is why one generated block can go on all of the pages.
It is the fallback for visitors whose language matches none of your versions. Google recommends it, and says it was designed for language-selector pages, so it works best there, though it can be used on any page. It takes no language code.
No. Google says only ISO 639-1 language codes and ISO 3166-1 alpha-2 region codes are supported, so es-419 is not, and that EU, UN and UK have no effect. For the United Kingdom write en-GB. A region also cannot stand alone: be is the language Belarusian, and for Belgium Google suggests de-BE, nl-BE or fr-BE.
Google says that if two pages do not both point to each other, the tags will be ignored, so that someone on another site cannot name your page as an alternative version of theirs. The fix is to put the same complete set on every version. The generator cannot open your live pages, so check each one's source by hand.
No. Google says it does not use hreflang or the HTML lang attribute to detect the language of a page, and uses its own algorithms instead. hreflang only says which pages are alternate versions of each other, so Search can offer the right one by language or region.
No. The tags are written in your browser and nothing you type or paste leaves the page. It does not open your pages either, so it cannot confirm that the live tags match.
Google’s page was opened and read in full on 24 November 2026; every rule marked Google above is on it, and nothing here claims how other search engines treat hreflang. The lists of language and region codes come from PHP’s ICU data, not ISO’s own pages. The rows marked Ours are this tool’s own advice. ← All free tools
More on website translation
All translation guides- How to Translate Your Website into Spanish How to translate your website into Spanish: which Spanish to use, three routes and what Google sees, and a word counter that prices the Spanish version.
- Translate a Squarespace Website: 3 Ways Compared Squarespace has no built-in way to translate your own content. Duplicate pages, Weglot or a script tool, step by step for 7.1 and 7.0, with a word counter.
- Website Translation Cost: Per Word, Plan or String What it costs to translate a website: per-word rates, Weglot and GTranslate plans checked today, and a receipt that also prices every edit after launch.
- GTranslate Alternative: Which Free Plan Gets Indexed? GTranslate Free translates in the browser: not indexed, not for business sites. Compare TranslatePress, Polylang, WPML, Weglot and Builderify, priced.
Stop losing the visitors
you already paid for.
More leads from the traffic you already have, and follow-up that sends itself. Free to start. No card, no monthly fee.