Free SEO Tool

Hreflang Tag Generator

Add each language or regional version of your page and get valid hreflang tags in HTML, XML sitemap, and HTTP header formats, ready to paste.

LanguageRegionPage URL
HTML tags: add to the <head> of every version
XML sitemap: alternates for each <url> entry
HTTP header: for PDFs and other non-HTML files

Running SEO across countries?

International SEO is easy to get subtly wrong. Our team sets up hreflang and regional targeting the right way.

Book a Free Call

How to use the hreflang tag generator

  1. Pick the language (and region, if needed) for each version of your page and paste its full URL.
  2. Add an x-default row pointing to your fallback page for everyone else.
  3. Copy one format and add the same complete set to every language version of the page.

What is an hreflang tag?

An hreflang tag tells search engines which language or regional version of a page to show a given user. If you have the same content for, say, US English, UK English, and Spanish, hreflang links those versions together so Google serves the right one, and doesn't treat them as duplicates.

Why hreflang matters

Without it, search engines may show the wrong-language page, or pick one version and ignore the rest. Correct hreflang keeps each audience on the version made for them, which improves experience and protects the rankings of every version. The catch: the tags must be reciprocal, so every page has to reference all the others, including itself.

Frequently asked questions

When do I need hreflang?

When the same or very similar content exists in more than one language, or is targeted at different countries (like US and UK English).

Where do hreflang tags go?

In the page <head>, in your XML sitemap, or in the HTTP header. Pick one method. Mixing them can cause search engines to ignore both.

Does every page need to reference itself?

Yes. Each page must list every version including itself (return links). If the references aren't reciprocal, Google ignores them.

What is x-default?

It's the fallback version shown to users whose language or region you don't specifically target, often your homepage or a language selector.

What's the difference between hreflang and the html lang attribute?

The lang attribute describes the language of one page. Hreflang maps the relationship between alternate versions across URLs.

Do I put hreflang on every page or just the homepage?

On every page that has language or regional alternates. Each URL points to its own set of equivalents, not just the homepage.

Does hreflang improve my rankings?

Not directly. It serves the right version to the right users and prevents duplicate-content confusion, which protects the performance you already have.

Related free SEO tools

Explore the rest of our toolkit or get a hand from our team:

See all free SEO tools →