Hreflang Tags Generator

Map every locale to the correct URL and generate copy-ready hreflang tags for your international site.

Locale entries

List each language-country pair and its canonical URL.

Locale #1

Lowercase, hyphen separated.

Locale #2

Lowercase, hyphen separated.

Locale #3

Lowercase, hyphen separated.

Generated tags

<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr-fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Make search engines serve the right language

Avoid duplicate content confusion and help Google deliver the best version of each page to the right audience. This generator keeps syntax consistent and export-ready.

  • • Uses ISO 639-1 + ISO 3166-1 codes
  • • Supports unlimited locales
  • • Includes optional x-default entry

International SEO

Locale Matrix

<link rel="alternate" hreflang="en-us" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="fr-fr" href="https://example.com/fr-fr/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

How It Works

The Hreflang Tags Generator runs entirely in your browser using JavaScript. Unlike other tools that send your data to a server, we process everything locally on your device. This guarantees 100% privacy and blazing fast speed.

  • No server interaction – data never leaves your device
  • Instant results since there is no network latency
  • Works offline once the page is loaded
  • Free to use with no usage limits

How to Use

1

List languages/regions

Define every locale with its ISO code (e.g., en-us, fr-fr).

2

Match canonical URLs

Paste the localized URL that should appear for that market.

3

Copy hreflang tags

Paste into the <head> of each localized page or output via your CMS.

Frequently Asked Questions

Do I need both language and region?
Use language-country pairs when you target specific markets (en-us, en-au). Language-only codes (en) are valid for broad targeting.
Where should I place hreflang tags?
Inside the <head> of every localized page or via the HTTP header. Make sure each variant references all the others.
What is x-default?
It points to a fallback page (usually global or language selector) when Google can’t detect a matching locale.
Should URLs be absolute?
Yes. Always provide the full canonical URL with protocol to avoid ambiguity.
Do hreflang tags replace canonical tags?
No. Each localized page should still self-canonical. Hreflang simply connects equivalent versions.

Related Tools

The Hreflang Tags Generator is maintained by CodeItBro. We aim to provide the best free developer tools on the web. If you have feedback or suggestions, please visit our contact page.