Skip to content

Hreflang generator: complete tag sets for all your language versions

An hreflang generator for every page on your site. Paste a table of your language versions and get a complete, consistent set as HTML tags, an XML sitemap or HTTP Link headers.

First row: the hreflang codes (hr, en, de-AT, x-default). Then one row per page with the full URL of each version; leave a cell empty when that version doesn’t exist. Paste straight from a spreadsheet.

Processed in your browser. Nothing is uploaded.

Your language codes

  • hrCroatian
  • enEnglish
  • de-ATGerman (Austria)
  • x-defaultFallback for every other language

Your hreflang markup

Each block goes in the <head> of the page named above it. Every version lists all versions, itself included.

hreflang-tags.html
<!-- In the <head> of https://example-shop.hr/ -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/" />
<link rel="alternate" hreflang="x-default" href="https://example-shop.hr/en/" />

<!-- In the <head> of https://example-shop.hr/en/ -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/" />
<link rel="alternate" hreflang="x-default" href="https://example-shop.hr/en/" />

<!-- In the <head> of https://example-shop.hr/de/ -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/" />
<link rel="alternate" hreflang="x-default" href="https://example-shop.hr/en/" />

<!-- In the <head> of https://example-shop.hr/majice -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/majice" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/shirts" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/hemden" />

<!-- In the <head> of https://example-shop.hr/en/shirts -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/majice" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/shirts" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/hemden" />

<!-- In the <head> of https://example-shop.hr/de/hemden -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/majice" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/shirts" />
<link rel="alternate" hreflang="de-AT" href="https://example-shop.hr/de/hemden" />

<!-- In the <head> of https://example-shop.hr/kontakt -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/kontakt" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/contact" />

<!-- In the <head> of https://example-shop.hr/en/contact -->
<link rel="alternate" hreflang="hr" href="https://example-shop.hr/kontakt" />
<link rel="alternate" hreflang="en" href="https://example-shop.hr/en/contact" />
  • Free, no account
  • Runs in your browser
  • HTML tags, sitemap or HTTP headers

What the hreflang generator builds and checks

One table in, a complete and consistent set out. Every code is checked before you copy anything.

  • Three output formats

    Link tags for the page head, an XML sitemap, or HTTP Link headers for PDFs and other files.

  • Every code checked and named

    An ISO 639-1 language, optionally a country (de-AT), or x-default. Each code is named, such as "German (Austria)".

  • Common mistakes flagged

    Codes such as en-UK, en_US or a country without a language are flagged with the fix.

  • Complete sets, self included

    Each page gets the complete set of versions, itself included, which is what makes return links work.

  • Table problems first

    Rows with a single version, relative URLs and pages that appear in two rows are reported before you copy anything.

Show 1 more check
  • Table problems first

    Rows with a single version, relative URLs and pages that appear in two rows are reported before you copy anything.

How the hreflang generator works

  1. Name the versions

    The first row names the versions: a language, optionally a country, or x-default for everyone else.

  2. Add one row per page

    Each row after it is one page in all its versions, as full URLs. The table is checked as you go.

  3. Copy the output

    Choose tags, sitemap or headers and copy the result. Use one method per page, not several.

The tags are built from your table only; the tool doesn't visit the URLs, so it can't confirm that every version is live.

Hreflang generator questions

What hreflang code should I use for English in the UK?

en-GB. Hreflang uses ISO 639-1 language codes and ISO 3166-1 region codes, and the region code for the United Kingdom is GB, not UK, so en-UK is invalid and ignored. Other common slips are en_US with an underscore and a country on its own, such as us. The generator flags each of these with the fix as you type.

How do I set up and implement hreflang?

List every language version of each page, then give every version the full set of hreflang entries, including itself, with full URLs and valid codes such as de-AT or en-GB. Pick one method per page: tags in the head, the sitemap or headers. Paste your versions into the table above, copy the output, then run a page through our hreflang checker to confirm the return links work.

What is hreflang x-default, and do I need it?

x-default names the page for everyone whose language or country you do not cover, usually a language picker or your main English page. It is recommended rather than required: the other entries work without it. Add it as a column in the table above and the generator includes it in every set.

Does each page need a self-referencing hreflang tag?

Yes. Each version should list itself as well as all the others. Google recommends it, and a set that leaves out the page it sits on is a common reason return links fail. The generator always includes the self-reference, which is why every page gets the complete set rather than only the other versions.

Tags, sitemap or headers: which one should I use?

Use one method per page, not several. Tags in the head are simplest for small sites. The XML sitemap suits large sites and platforms where you cannot edit the head, and it is easier to keep up to date. HTTP Link headers are for PDFs and other files that have no HTML head. All three carry the same information.

How do I add hreflang in WordPress?

Multilingual plugins such as WPML, Polylang and TranslatePress add hreflang tags for the translations they manage, so check the page source before adding anything. If your versions live on separate sites or domains, generate the sitemap here and upload it to each site. Never combine plugin tags with a hand-made set on the same page.

Can I use hreflang across different domains?

Yes. Versions can live on different domains, such as example.hr and example.de; list the full URL of each. Every domain must carry the complete set, so every site needs the same tags or the same sitemap entries. Update all of them together whenever you add or remove a version.

All 59 tools →

Free, funded by the people who use it

No account, no paid plan. Donations keep it running.

Chip in