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.

Google’s rules 14 checks · nothing leaves the page Checked 24 Nov 2026

By the Builderify team

Hreflang tag generator Runs in your browser
Start from

One line per version: its code, a space, then its full address. Add a line starting x-default for the fallback.

4 lines written
<link rel="alternate" hreflang="en" href="https://example.com/" /> <link rel="alternate" hreflang="de" href="https://example.com/de/" /> <link rel="alternate" hreflang="fr" href="https://example.com/fr/" /> <link rel="alternate" hreflang="x-default" href="https://example.com/" />

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

01 / How a code is written

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.

02 / Where the tags go

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 &amp; in HTML and XML.

HTML link tags

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.

An HTTP Link header

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.

An XML sitemap

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.

04 / The 14 checks

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.

The checks the hreflang generator runs, and whether each comes from Google’s page or from this tool
Looks at What it finds Whose rule
Code A language that is not two letters, or not in ISO 639-1 Google
Code A country with no language in front of it, and be and uk, which are languages Google
Code A region that is a number, is EU, UN or UK, or is not an assigned ISO 3166-1 code Google
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 Google
Address Not fully qualified: starts with // or /, has no http or https, no host name Google
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 Google
Set No x-default Google
Set Several regions of one language and no plain version of it Google
Set A mix of http and https Ours
Set A reminder that every version must carry the full set Google

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.

05 / On Builderify

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.

This site

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.

Builderify on WordPress

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.

Builderify on other platforms

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 free
Questions

Hreflang 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

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.