Hreflang Tag Generator - International SEO Tags

Generate hreflang link tags for multilingual websites. Supports x-default and XML sitemap format output.

How to Use

  • Click 'Add Language Version' to add each language/region URL pair.
  • Select the language/region code from the dropdown (e.g., 'en-US' for English US).
  • Enter the full URL for that language version (must be the absolute URL with https://).
  • Toggle 'Include x-default' to specify the default fallback URL shown to users whose language is not explicitly supported.
  • Click 'Generate' to create both HTML tags and XML sitemap format — add the HTML tags to the <head> of every language version.

About Hreflang Tags

What is Hreflang?

Hreflang is an HTML attribute (and XML sitemap element) that tells Google which language version of a page to serve to users in different locations. It was introduced by Google in 2011 to solve the problem of international SEO — helping Google understand that multiple versions of a page exist for different languages or regions. Without hreflang, Google may show the wrong language version to international users, hurting engagement.

Hreflang Tag Requirements

For hreflang to work correctly: every language version must link to all other versions (including itself), the URLs must be absolute (full URL with https://), the hreflang values must use valid ISO 639-1 language codes (e.g., 'en', 'fr') optionally combined with ISO 3166-1 Alpha-2 country codes (e.g., 'en-US', 'fr-FR'), and the x-default tag should point to the page shown when no language-specific version matches the user's language.

x-default Attribute

The x-default hreflang value (<link rel='alternate' hreflang='x-default'>) designates the fallback page shown to users whose language or region does not match any of the explicitly listed language variants. This is typically your homepage or a language selector page. It's optional but strongly recommended as a best practice. Google uses x-default to handle users from regions not explicitly covered by your hreflang annotations.

Hreflang in XML Sitemaps

As an alternative to HTML link tags (which must appear on every page), you can include all hreflang annotations in your XML sitemap using the xhtml:link namespace. This is especially useful for large sites where adding HTML tags to every page is impractical. The sitemap must include all language alternatives for each URL. Both methods (HTML and sitemap) are equally valid and recognized by Google — choose based on your site's architecture.

Key Features

  • Supports 20+ language and region code combinations
  • Generates both HTML <link> tags and XML sitemap format
  • Includes x-default support for fallback language handling
  • Validates that all required hreflang elements are present

Common Applications

  • Setting up international SEO for multilingual websites targeting multiple countries
  • Differentiating between regional content variations (US vs UK English, Brazil vs Spain Spanish)
  • Fixing Google Search Console errors related to hreflang implementation
  • Generating sitemap entries for large multilingual sites