ZZenvuk
Technical SEO

Hreflang Generator

Generate international hreflang alternate link tags for HTML headers and XML sitemaps with ISO language/region validation and x-default support.

FREE NO LOGIN BROWSER BASED

Language & Regional Alternate URLs

Specify language (ISO 639-1) and optional country (ISO 3166-1) codes for each regional version.

#1
#2
#3
#4
#5
Hreflang Syntax & Integrity VerificationISO 639-1 & ISO 3166-1 Alpha 2

• Reciprocal link reminder: Every alternate URL must also link back to all other regional URLs with matching hreflang tags.

<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<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="es-ES" href="https://example.com/es-es/" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/" />

Paste these tags inside the <head> element on all localized variations of this page.

What Is Hreflang?

Quick Answer:

Hreflang is an HTML link attribute (rel="alternate" hreflang="x") introduced by Google in 2011 to tell search engines about localized and multi-language variations of a single webpage. By mapping URLs to specific language (ISO 639-1) and regional country (ISO 3166-1) codes, search engines serve the geographically and linguistically appropriate URL to international users.

Without accurate hreflang annotations, search engines may treat localized pages as duplicate content or rank the American English version for a user searching in London, Sydney, or Madrid. Zenvuk's generator creates valid markup for both HTML page headers and XML sitemaps with real-time ISO validation.

How to Generate Hreflang Tags

  1. Map Regional URLs: Identify each translated or localized URL version for a specific piece of content (e.g. your English, Spanish, and French editions).
  2. Assign Language & Country Codes: Use two-letter ISO 639-1 language codes (e.g., en, es) and optional ISO 3166-1 Alpha 2 country codes (e.g., US, GB).
  3. Designate x-default Fallback: Choose an unlocalized or global landing URL as your fallback for visitors whose language/region is not explicitly targeted.
  4. Select Output Format: Choose between HTML <link> tags for template headers or XML sitemap snippets.
  5. Ensure Reciprocal Links: Implement identical sets of hreflang tags across all alternate pages so every version links to all sister URLs.

Hreflang Language Codes

Search engines strictly require language attributes to follow the ISO 639-1 format. Common examples include:

en — English
es — Spanish
fr — French
de — German
it — Italian
pt — Portuguese
ja — Japanese
zh-Hans — Chinese (Simplified)
zh-Hant — Chinese (Traditional)

Language vs Region Targeting

Understanding the distinction between purely linguistic targeting and regional geographic targeting is essential for international architecture:

Language Only (e.g. "en" or "es")

Matches all speakers of that language worldwide, regardless of whether they are located in the US, Australia, South Africa, or India.

Language + Country (e.g. "en-GB" or "es-MX")

Restricts targeting to speakers of that language inside a specific nation. Essential for ecommerce stores with localized pricing, shipping, or currencies.

Important Rule: You cannot specify a country code alone (e.g. hreflang="GB" is invalid). The language code must always come first.

What Is x-default?

The hreflang="x-default" attribute specifies the fallback page served when none of your explicit language-region tags match a user's browser settings or query intent. It is frequently applied to:

  • Country-selector or language-picker splash pages.
  • Global English homepages serving visitors from non-targeted countries.
  • Dynamic redirect portals that route visitors automatically via IP geolocation.

Hreflang HTML Example

<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/" />

Remember: This identical block of 5 tags must appear in the <head> of all five pages.

Hreflang in XML Sitemaps

For large websites with dozens of regional languages, injecting 30+ link tags into every HTML page can bloat page weight and delay First Contentful Paint. Implementing hreflang via an XML Sitemap keeps your HTML lean:

<url>
  <loc>https://example.com/us/</loc>
  <xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
  <xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
  <xhtml:link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
</url>

Common Hreflang Errors

Missing Return Tags

If Page A links to Page B, but Page B does not link back to Page A, Google disregards both tags to prevent third-party spoofing.

Non-Canonical Targets

Pointing hreflang tags to URLs that 301-redirect or canonicalize elsewhere creates indexing conflicts. Pair with our Canonical Tag Generator to ensure targets are self-referencing.

Country Codes Used as Languages

Using hreflang="uk" (Ukrainian language) instead of en-GB (English in United Kingdom) is a frequent mistake.

Relative URLs

Hreflang attributes strictly require absolute URLs with explicit protocols (e.g. https://example.com/fr/).

Hreflang and International SEO

International SEO is built upon three technical pillars: localized content quality, geographical server or CDN routing, and hreflang tag integrity. When deployed properly, hreflang prevents regional self-cannibalization between US, UK, and Australian stores, consolidates regional ranking equity, and lowers bounce rates by delivering users to their native dialect.

Hreflang Generator FAQs

What is hreflang used for?

Hreflang tells search engines which localized URL to show users based on their spoken language and geographic location, preventing regional cannibalization.

What is the difference between ISO 639-1 and ISO 3166-1?

ISO 639-1 defines 2-letter language codes (e.g. "en" for English, "de" for German), while ISO 3166-1 defines 2-letter country codes (e.g. "US" for United States, "DE" for Germany).

Should a page include an hreflang tag pointing to itself?

Yes. Every page must include a self-referencing hreflang tag in addition to alternate links pointing to its sister variations.

Can I combine HTML hreflang tags and XML sitemap hreflang?

While technically possible, Google recommends choosing one implementation method to avoid discrepancies and synchronization bugs.

Is my international data sent to remote servers?

No. Zenvuk's Hreflang Generator operates 100% locally in your browser. None of your URLs or language configurations are transmitted to our servers.

Related Utilities

Continue your workflow

View all tools