Hreflang Generator

Generate hreflang alternate tags for multilingual sites with BCP-47 validation, x-default support, and duplicate detection.

Hreflang Generator

Generate hreflang alternate links so Google and AI engines serve the right language version of each page to every market. One row per URL, with all its locale variants.

The absolute URLs are built from this.

No base URL — links will be relative.

x-default points to the page itself — Google uses it for visitors whose language you don't serve.

hreflang tagshtml
<link rel="alternate" hreflang="en" href="/path-to/" />
<link rel="alternate" hreflang="es" href="/path-to/" />
<link rel="alternate" hreflang="fr" href="/path-to/" />
<link rel="alternate" hreflang="de" href="/path-to/" />
<link rel="alternate" hreflang="pt" href="/path-to/" />
<link rel="alternate" hreflang="ja" href="/path-to/" />
<link rel="alternate" hreflang="x-default" href="/path-to/" />
Google requires hreflang pages to be mutually reciprocal: every URL in the set must link back to every other URL in the same set. Generate this block for each of the URLs above.

A hreflang generator that builds the alternate-link tags multilingual sites need — with BCP-47 locale validation, x-default support, and duplicate detection that most free generators skip. hreflang tells Google and AI engines which language version of a page to serve to which market, preventing duplicate-content confusion across your locales.

Why hreflang matters for international SEO

If you serve the same page in English, Spanish, French, and German, search engines see four URLs with similar content. Without hreflang, Google guesses which one matches a searcher — and guesses wrong often enough to hurt both rankings and UX. hreflang tells every engine which URL is the English version, which is the Spanish version, and which is the catch-all. AI engines also read hreflang to understand your site's structure across languages.

The x-default rule most tools get wrong

x-default tells search engines which URL to show to visitors whose language you do not explicitly serve — it can point to a specific locale page or to your main URL. Google's documentation recommends including it, and its absence is one of the most common hreflang mistakes found in audits. This generator adds it automatically when you enable the option.

Reciprocity: the rule that makes or breaks hreflang

Google requires hreflang sets to be mutually reciprocal: if page A declares page B as an alternate, page B must declare page A too. A one-way link is treated as an error and the whole set can be ignored. The generator emits a complete block per URL — copy it onto each page in the set, and reciprocity holds by construction.

Validating your locales before you publish

Google rejects malformed language codes. Locales must follow BCP-47 (language plus optional region, like es-ES or pt-BR), and each URL can declare any given locale only once. The generator validates every code as you type, flags duplicates, and warns when the same URL appears in multiple rows — so the tags you copy are deployable on the first try.

Frequently Asked Questions