Free International tool

Free Hreflang Tag Generator

An hreflang generator creates the tags that tell search engines which language or regional version of a page to show each user. SEO Portals builds a complete, reciprocal set of hreflang tags, including x-default, as HTML link tags, XML sitemap entries or an HTTP Link header, and flags invalid language codes.

Free · No sign-up, unlimited use · Updated · By the SEO Portals team

How do hreflang tags work?

Each language or regional version of a page lists every version of that page, including itself, with its language code (like en, es or en-GB) and URL. Search engines use these sets to show the right version to the right searcher. If tags aren't reciprocal, so a page links to another that doesn't link back, Google ignores them.

How to use the Hreflang Tag Generator

  1. List each version as a language code and URL, one per line.
  2. Add an x-default fallback URL.
  3. Choose HTML, sitemap or HTTP header output.
  4. Add the same set of tags to every version of the page.

Why it matters for SEO

  • Shows each audience its own language and currency.
  • Stops translated pages competing as duplicates.
  • Hand-writing dozens of reciprocal tags is error-prone.
  • Supports all three methods Google accepts.

Key facts

  • Language codes use ISO 639-1; regions use ISO 3166-1 alpha-2.
  • Every version must list all versions, including itself.
  • x-default sets the fallback for unmatched users.
  • Output formats: HTML, XML sitemap or HTTP Link header.

Hreflang Tag Generator FAQ

Which hreflang method is best?

HTML tags are easiest for most sites. Sitemaps suit large sites with many languages. HTTP headers are for non-HTML files like PDFs.

Is it en-UK or en-GB?

en-GB. GB is the ISO country code for the United Kingdom.

Do I need hreflang for one language?

No. Hreflang is only for sites with multiple language or regional versions of the same content.

How do I test my hreflang tags?

Use our Hreflang Checker to confirm every alternate links back.

Check every page, not just one

Run a full-site audit free and get every issue ranked by impact.

Audit my whole site free