Skip to content

Hreflang Tag Generator

Create hreflang tags for every language version of a page.

How to use the hreflang tag generator

Three steps, all in your browser.

  1. 1

    Start from your page

    Have the page's title, URL and key details to hand.

  2. 2

    Set the rules

    Add rules or URLs. The result updates instantly.

  3. 3

    Copy the result

    Copy what you need in one click. Nothing is saved or sent anywhere.

Hreflang Tag Generator: what to know

hreflang tells search engines that several pages are versions of the same content for different languages or regions, so each searcher can be shown the right one. The hreflang tag generator takes your list of versions, a language code (and optional region) with a URL for each, and writes the annotations as link rel="alternate" hreflang tags for the HTML head, xhtml:link entries for an XML sitemap or HTTP Link headers, including x-default for visitors who match none of them. It checks the codes as you go and catches common mistakes such as en-UK instead of en-GB.

Values are an ISO 639-1 language code, optionally followed by an ISO 3166-1 alpha-2 region code: en, en-GB, de-CH, es-MX. Google also supports script codes such as zh-Hans and zh-Hant, but not UN M.49 region codes such as 419. The hardest rule is reciprocity: every version must list every other version and itself, or Google may ignore the annotations, which is why the same block of tags goes on every page in the set.

hreflang doesn't make pages rank higher, and Google can still show another version if it judges it a better match. It's most useful when versions are similar, such as English for the US and the UK, or when you want searchers sent to the right country site. Each URL should be absolute, canonical and return 200.

Popular uses

  • Launching a site in a new language or country
  • Separating US, UK and Australian English pages
  • Adding an x-default language picker page
  • Fixing hreflang errors reported in an audit

Tips for the best result

  • Paste the same block of tags on every version of the page.
  • Use one method per set of pages: HTML tags, HTTP headers or the sitemap.
  • Point each URL at the canonical version, never at a redirect.

Learn more

Read how JustYourSEO works and our privacy details. Text, HTML and images you use here are processed in your browser and are never sent to our server.

Frequently asked questions

It tells search engines that several pages are versions of the same content for different languages or regions, so each user can be shown the right one. It doesn't boost rankings.

Yes. Each version must list all the others and itself. If page A points to page B but B doesn't point back, Google may ignore the annotations. Paste the same block on every version.

The page to show when no listed language or region matches the user, often a language picker or the international English page. It's optional but recommended.

No. The text, HTML, files and images you paste or open are processed on your device and are not sent to our server or stored. The five URL tools (SEO audit, indexability checker, redirect checker, HTTP header checker and broken link checker) are the exception: they send the URL you enter to our server, which requests that public page (and, for the broken link checker, each link on it) and returns what it received to your browser to check. The URL and the page aren't stored or logged. The optional Import from URL in the meta tag, Open Graph and Twitter card generators works the same way.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

They help you get the details right: tags that are complete and valid, previews that read well, files crawlers can parse. No tool can guarantee rankings; those depend on your content, your site and how search engines evaluate them.