Hreflang tag generator

Generate hreflang tags for the language versions of a page.

  • SEO
  • 100% free
  • No sign-up
  • Runs in your browser
Hreflang tag generator
One version per line: the language (or language-region) code, then the URL.
The page for users whose language is not listed (optional).

What is the hreflang tag generator?

The hreflang tag generator creates the annotations that tell search engines which language or regional version of a page to show to each user. List the versions with their language codes and URLs, add an x-default page, and choose the HTML, XML sitemap or HTTP header format.

Codes are validated and normalized (en-gb becomes en-GB), and each version lists all the others, including itself, which is the most common hreflang mistake.

How to use the hreflang tag generator

  1. 1Write one version per line: the language code (or language-region code) and the URL.
  2. 2Add the x-default URL for all other users.
  3. 3Choose the output format and add the code to every version of the page.

Features

Three formats

HTML link tags, XML sitemap entries or an HTTP Link header.

Code validation

Language, script and region codes are checked and normalized.

x-default

Add the fallback page for unmatched languages.

Complete sets

Every version references all the versions, itself included.

Frequently asked questions

What is hreflang?

An annotation that tells search engines about the language and regional versions of a page, so each user gets the right one.

What is x-default?

The page shown to users whose language or region doesn't match any of the listed versions, often a language selector or the main version.

Is it en-gb or en-uk?

en-gb. Region codes follow ISO 3166-1, where the United Kingdom is GB.

Do all versions need the tags?

Yes. Hreflang must be reciprocal: if page A points to B, B must point back to A.