Launch
Ask AI

Hreflang tag generator

Language versions → hreflang link tags, sitemap entries or HTTP headers, with x-default.

Runs in your browser — nothing is uploaded · free, no signup

Hreflang tags tell Google which language or regional version of a page to show each searcher. Writing them by hand is where most mistakes happen: a missing return link, a wrong code, no x-default. List your versions once and get the full, matching set for every page.

How to use the Hreflang tag generator

  1. Enter each language version as a code and its full URL, one per line.
  2. Set the x-default URL, usually your main or language-picker page.
  3. Copy the output as HTML link tags, sitemap entries or an HTTP header, and add the same set to every version.

Which format to use

HTML link tags in the head are the simplest and work for most sites. The XML sitemap format is easier to manage on large sites, since you change one file instead of every template. The HTTP Link header is for files that have no HTML head, such as PDFs. Pick one method per page; mixing them is allowed but makes mistakes harder to spot.

Getting the codes right

Use an ISO 639-1 language code (en, de, pt), optionally followed by an ISO 3166-1 region (en-GB, pt-BR). The region alone is not valid: "uk" means Ukrainian, not the United Kingdom, and the region for Britain is GB. For scripts, use the script subtag, like zh-Hant for Traditional Chinese. The generator skips lines with invalid codes and tells you why.

Why return links matter

Every version must list all the others and itself. If the German page points to the English one but the English page doesn't point back, Google ignores the pair. That's why the generator gives one identical block to paste on every version, and why it's worth running the hreflang checker on each page after you publish.

More technical seo tools

Hreflang tag generator FAQ

The version for searchers whose language or region doesn't match any of yours, often the English page or a language selector. It's optional but recommended.

Launching soon?

Get a permanent product page and a dofollow backlink on DiscoverLaunches.

Launch free

← All 74 tools