RomeoSEO

Generators

Hreflang tag generator

Generate hreflang tags for every language and country version of a page, with x-default, as HTML link tags, XML sitemap entries or an HTTP header.

Free · No signup · Runs in your browser

Your language and country versions

One row per version of the page. Leave the country empty to target a language everywhere.

  1. en
  2. en-GB
  3. de

Usually your main site or a language picker.

Paste a list instead

Common slips are fixed and explained: en_UK becomes en-GB, jp becomes ja.

3 versions plus x-default

1 worth fixing

Paste the same tags into the <head> of every version listed.

HTML
<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Checks

  • Worth fixing

    Replace example.com with your own addresses

  • Note

    Put the same full set on every version

    Each version must list every other version and itself. If the German page links to the English page but not back, Google ignores the pair. Each version's canonical should point to itself, not to the main language.

How it works

  1. Add a row for each version: its language, an optional country, and its full address.

  2. Pick an x-default for everyone else, or paste a list of codes and addresses instead.

  3. Copy the format you use and put the same set on every version.

What hreflang does

Hreflang tells search engines that several pages are versions of the same content for different languages or regions, and which version is for whom. Someone searching in German gets the German page; someone in the UK gets the en-GB page rather than the American one.

It doesn't move a page up the rankings, and it isn't a redirect. It helps the right version show for the right searcher, and helps Google understand that near-identical versions, like UK and US English, are meant for different audiences rather than competing copies.

How the codes work

Each value is a language code, optionally followed by a country code: en, en-GB, es-MX. The language comes first and is required; it's a two-letter ISO 639-1 code. The country is optional and uses the two-letter ISO 3166-1 list. For Chinese you can target the script instead: zh-Hans for Simplified and zh-Hant for Traditional.

The generator catches the usual slips, and the paste box fixes them for you with an explanation:

  • en-UK: the United Kingdom's code is GB, so it's en-GB.
  • jp, cn, dk: those are countries. Japanese is ja, Chinese is zh, Danish is da.
  • A country on its own, like GB: hreflang always needs the language first.
  • es-419 for Latin America: Google doesn't support region numbers, so list each country or use plain es.
  • Underscores, like en_US: hreflang uses a hyphen.

Every version lists every version, including itself

Hreflang only works in pairs. If the French page points to the English page, the English page must point back to the French one. Google calls these return links and ignores annotations that aren't confirmed both ways. The simplest way to get it right is to put the exact same block on every version: the code this tool gives you, unchanged, on each page in the set.

Each version also needs a canonical tag that points at itself. A French page whose canonical points at the English page is telling Google to drop the French one, which overrides the hreflang.

x-default, and choosing a format

x-default is the fallback for anyone who matches none of your versions: a language picker, or your main international page. It's optional, but it tells Google what to show everyone else.

There are three equivalent ways to publish hreflang, and one is enough: link tags in each page's head, entries in your XML sitemap, or an HTTP Link header. The sitemap suits large sites, because the annotations live in one file instead of every template. The header is for files that have no head, like PDFs. If you use more than one method for the same pages, they must say exactly the same thing.

What this generator can't check

It checks the codes and addresses you give it, not your live site. It can't see whether each version really links back, whether a version redirects, returns an error or is blocked from crawling, or whether its canonical points somewhere else. The hreflang checker reads up to 20 live versions and tests exactly that.

Questions people ask

Do I need hreflang if my site has one language?

No. Hreflang is for sites with more than one language or regional version of the same page. A single-language site doesn't need it, even if it sells abroad.

Should I use en or en-US?

Use plain en when one English page serves everyone. Add country codes only when versions really differ, for example in prices or spelling. If you have regional versions, a plain en version or a good x-default catches English speakers in other countries.

Do the addresses have to be full URLs?

Yes. Each address must include https:// and the domain. Relative paths like /fr/ don't work in hreflang.

Is hreflang case-sensitive?

No. en-gb and en-GB mean the same. The convention is a lowercase language and an uppercase country, which is what this tool writes.

Is my list sent anywhere?

No. The tags are built in your browser, with no signup.

Want it done for you?

Romeo keeps every language version linked up

He crawls each version of your site, finds missing return links, wrong codes and canonicals that point at the wrong language, and sends the fixes for you to approve.

Join the waitlist

We’re opening access in stages. Leave your email and we’ll let you know when Romeo is ready for your site.