Generate hreflang alternate link tags for i18n SEO.
Tip: use samples, upload, copy, download, and send-to actions inside the workspace where available.
Hreflang Generator is a free, browser-based tool that helps you produce ready-to-use output in seconds. Generate hreflang alternate link tags for i18n SEO. It's built for speed and privacy: Everything runs locally in your browser — your data is never uploaded to a server. No sign-up, no installs, and no daily limits.
Generate a sample or helper artifact, then copy it into the workflow that needs it.
Review the preview, copy or download the result, and keep everything local in your browser.
Canonical Tag Generator: Generate a rel=canonical link tag to avoid duplicate content.
Open toolUsed to verify the set includes a self-reference.
hreflang="en-US"English speakers in United Stateshreflang="es-ES"Spanish speakers in Spainhreflang="fr"French speakers, any regionx-default is the fallback served to users whose language and region match no alternate. It is normally a language selector or your global/English page — not a fourth translation.
| hreflang | Page that must return the set | Tags required |
|---|---|---|
| en-US | https://example.com/ | 4 |
| es-ES | https://example.com/es/ | 4 |
| fr | https://example.com/fr/ | 4 |
| x-default | https://example.com/ | 4 |
<link rel="alternate" hreflang="en-US" href="https://example.com/" /> <link rel="alternate" hreflang="es-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/" />
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/" />
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>
<url>
<loc>https://example.com/es/</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/" />
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>
<url>
<loc>https://example.com/fr/</loc>
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/" />
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/" />
<xhtml:link rel="alternate" hreflang="fr" href="https://example.com/fr/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/" />
</url>
</urlset>
Link: <https://example.com/>; rel="alternate"; hreflang="en-US" Link: <https://example.com/es/>; rel="alternate"; hreflang="es-ES" Link: <https://example.com/fr/>; rel="alternate"; hreflang="fr" Link: <https://example.com/>; rel="alternate"; hreflang="x-default"
export const metadata: Metadata = {
alternates: {
languages: {
"en-US": "https://example.com/",
"es-ES": "https://example.com/es/",
"fr": "https://example.com/fr/",
"x-default": "https://example.com/",
},
},
};en-GB. Not GB-en, not en_GB, and never UK — the ISO 3166 code for the United Kingdom is GB.