Hreflang Tag Generator

Generate hreflang link tags for multilingual and multi-regional websites. Specify language-region pairs and get ready-to-use HTML, HTTP header, or XML sitemap code.

Add Language-URL Pairs
Common Language Codes
af sq am ar ar-ae ar-bh ar-dz ar-eg ar-iq ar-jo ar-kw ar-lb ar-ly ar-ma ar-om ar-qa ar-sa ar-sy ar-tn ar-ye hy eu be bn bg ca zh zh-cn zh-hk zh-sg zh-tw hr cs da nl nl-be en en-au en-bz en-ca en-gb en-ie en-jm en-nz en-ph en-sg en-tt en-us en-za et fi fr fr-be fr-ca fr-ch fr-fr fr-lu fr-mc gl ka de de-at de-ch de-de de-li de-lu el gu he hi hu id it it-ch it-it ja kn kk km ko lo lv lt mk ms ml mt mr ne nb fa pl pt pt-br pt-pt pa ro ru sr si sk sl es es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-gt es-hn es-mx es-ni es-pa es-pe es-pr es-py es-sv es-uy es-ve sw sv ta te th tr uk ur vi cy x-default
Generated Output

  

Frequently Asked Questions

An hreflang tag is an HTML attribute that tells search engines the language and geographical targeting of a page. It is used by Google and Yandex to serve the most relevant version of a page to users based on their language and location, preventing duplicate content issues across multilingual or multi-regional sites.
The x-default value is strongly recommended. It designates the fallback page to show when no other hreflang value matches the user's language or region. Typically this points to your main English-language page or a language-selection page. Without x-default, Google may choose any version as the fallback.
Language-only codes like en target all English speakers regardless of country. Language-region codes like en-GB or en-US target English speakers in a specific country. Use language-only when the content doesn't vary by region; use language-region when it does — for example, different prices, dates, or vocabulary.
No — Bing does not support hreflang. Bing uses its own method of language detection based on page content, meta language tags, and the HTML lang attribute. The hreflang tags have no effect on Bing's indexing or language targeting. However, the HTML lang attribute on the <html> element does help Bing.
Yes, XML sitemap implementation is one of three valid methods: HTML link tags in the head, HTTP headers (for non-HTML files like PDFs), and XML sitemaps. The XML sitemap method is especially useful for large sites because you only need to update one file rather than every page. All methods are equally supported by Google.

About This Hreflang Generator

This tool generates correct hreflang markup for multilingual or multi-regional websites. Add your language-URL pairs, choose HTML link tags, HTTP headers, or XML sitemap format, and copy the output directly into your site.

Implementation methods

  • HTML link tags — placed in the <head> of each page
  • HTTP headers — for PDF files and non-HTML documents
  • XML sitemap — centralised management via your sitemap file

Hreflang rules to follow

  • Every page in the set must reference all other pages, including itself
  • URLs must be absolute and include protocol (https://)
  • Use ISO 639-1 language codes and ISO 3166-1 alpha-2 country codes
  • Always include an x-default fallback pointing to the default or selector page

Related Articles

In-depth guides and technical articles.

View all →
Hreflang Tags With Underscores Are Silently Ignored — ISO Code Syntax, Bidirectional Links, and Implementation Methods
Hreflang tags with underscores (en_GB instead of en-GB), lowercase region codes (en-gb), or uppercase language codes (EN-GB) are silently ignored by Google with no error message. Here's the ISO 639-1 and ISO 3166-1 case requirements, why self-referential tags and bidirectional return links are both required, the three implementation methods and why mixing them breaks the cluster, and when country-targeting without language differences works.
Why Correct Hreflang Doesn't Guarantee Correct Language Targeting — The Content Quality Signals Google Also Checks
Correct hreflang implementation doesn't guarantee correct language targeting — Google treats hreflang as a strong hint, not a command, and will override it if the targeted language version has thin content, poor quality signals, or unreliable crawl accessibility. Here's what Google checks alongside hreflang (content quality, backlinks from the target language's web, user behavior), why machine translation creates a quality threshold problem, and how partial hreflang coverage is handled.
Hreflang x-default: What Happens to Users Your Language Tags Don't Cover
"x-default" isn't a language code — it's a special hreflang value meaning "show this to anyone whose language/region didn't match any other entry." Omitting it doesn't make hreflang "invalid," but it delegates the "what do unmatched users see" decision to search engines' own logic. Here's the choice between a generic-international version and a language-selector page, why the selector page itself needs to participate in the reciprocal hreflang set, and why "x-default" never happens implicitly just because a URL "feels like" the main one.
Geo-Redirects vs Hreflang: How Automatic IP-Based Redirects Can Silently Break Your International SEO
A search engine crawler trying to access your French-language URL might get auto-redirected to your English version, based on the crawler's own IP location — meaning the URL your hreflang tags point to is never actually reachable by crawlers. Here's why IP-based geo-redirects and hreflang conflict, and the suggestion-banner and crawler-exemption approaches that resolve it.
Common Hreflang Implementation Errors and How to Debug Them
Most hreflang implementations have errors — missing return tags, wrong language codes, orphaned pages. Here's the seven most common hreflang mistakes, how to audit an existing implementation systematically, and what Google Search Console does and doesn't report.