Hreflang Generator

Generate hreflang tags for multilingual and multi-regional SEO

Language Versions

Generated Hreflang Tags

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

Related Tools

What are Hreflang Tags?

Hreflang tags tell search engines which language and regional version of a page to show to users. They prevent duplicate content issues and ensure users see content in their preferred language.

This generator creates the HTML link tags you need. Add all language versions of your page, including an x-default for users who don't match any specific language.

Language Codes

  • Language only: en, es, fr, de (ISO 639-1)
  • Language + Region: en-US, en-GB, pt-BR (ISO 639-1 + ISO 3166-1)
  • x-default: Fallback for unmatched users

Important Rules

  • Self-referencing: Each page must include a tag pointing to itself.
  • Reciprocal: All pages must link to each other.
  • Absolute URLs: Always use full URLs, not relative paths.
  • Canonical consistency: Hreflang URLs should match canonical URLs.

FAQ

Where do I put hreflang tags?

In the <head> of each page, or in HTTP headers, or in your XML sitemap.

Do I need x-default?

Recommended. It tells search engines where to send users who don't match any language.