Hreflang Tag Generator
Generate hreflang tags for multilingual pages.
<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/" />
Add these to the <head> of every page in the set — and each page should list all alternates including itself. x-default marks the fallback for unmatched languages.
Free hreflang tag generator. Add each language or region and its URL to generate the rel=alternate hreflang link tags, including an x-default fallback, for international SEO. Runs in your browser.
What hreflang solves
hreflang annotations tell search engines that you have multiple versions of a page for different languages or regions, and which version to serve to which audience. They prevent the wrong-language page ranking for a user and reduce the risk of your localized pages being treated as duplicates.
They matter for any site targeting more than one language or country — e.g. English for the US and the UK, or Spanish for Spain and Mexico.
The correct format
Each language version lists every version, including itself. The value is a language code, optionally with a region code:
<link rel="alternate" hreflang="en" href="https://example.com/">
<link rel="alternate" hreflang="en-gb" href="https://example.com/gb/">
<link rel="alternate" hreflang="es-mx" href="https://example.com/mx/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">
Rules:
- Language uses ISO 639-1 (
en,es); region uses ISO 3166-1 alpha-2 (us,gb). - Format is
languageorlanguage-region— never region alone. - Add
x-defaultfor the fallback page when no version matches the user.
Common mistakes
- Non-reciprocal tags: if page A points to B, B must point back to A, or the annotations are ignored.
- Using a country code as the language (
hreflang="uk"is wrong; the UK's language isen-gb). - Mixing hreflang across canonicalized pages — each URL must be self-canonical.
- Using relative URLs; hreflang requires absolute URLs.
- Forgetting
x-default, leaving users with no fallback.
How to use the Hreflang Tag Generator
- 01Add a row for each language or region and its URL.
- 02Use codes like en, en-US or es-MX.
- 03Set the x-default fallback URL.
- 04Copy the tags into the <head> of every page in the set.
Frequently asked questions
Do I need to list every language on every page?
Yes. Each page in a language set must reference all alternates, including itself. Missing return links are the most common hreflang mistake.
What is x-default for?
The x-default value marks the page shown to users whose language or region doesn't match any of your alternates — usually an international or language-selector page.