HTML head tags
Use it when: you control the HTML templates for ordinary web pages.
Usually the clearest choice: render the full same cluster in every page head.
Most broken hreflang deployments fail the same way: page A lists page B, but B never lists A back. Build the set here and every URL references every other and itself, so the set is bidirectional by construction — that mistake can't happen. A linter flags wrong codes, duplicates, and missing fallbacks as you type.
Example data — replace with your own
One row per locale version of the same page. Paste a URL with /de/ or a
de. subdomain and the locale fills itself in. Use arrow keys to move
between cells; Enter on the last row adds a new one. The optional per-row
x-default lets each page point unmatched users somewhere different (e.g.
a localized language selector) — leave it blank to use the shared one below.
| hreflang | URL | x-default (optional, per page) | Remove |
|---|
For many pages that share a URL pattern: define one URL template per locale with
{path} as the placeholder, then paste your paths. Each path becomes one
page set with the full alternate cluster.
| hreflang | URL template | x-default url template (optional, per page) | Remove |
|---|
Paste CSV/TSV rows (locale,url with an optional third
x-default column — a header row is fine) or a sitemap.xml
that already contains xhtml:link entries. It prefills the single-page
matrix (CSV) or bulk sets (sitemap), parsed entirely in your browser.
Add a locale and URL above to see output. Runs entirely in your browser — nothing you paste is uploaded or stored. Anonymous run-level outcome counters may be used for aggregate research; URLs, domains, IPs, and identifiers are never included, and no statistic is released below 100 runs.
Fetch a page you've already deployed: we read its live hreflang annotations, then fetch each declared alternate (up to 25) to verify return links and self-references.
A US and UK English site, with a generic en fallback and an x-default,
produces head tags like:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/uk/" />
<link rel="alternate" hreflang="en" href="https://example.com/us/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" /> …and running that cluster through the built-in linter reports:
en-us or en-US —
the generator always emits the uppercase region form (en-US), so casing typos never
become a problem.en is what makes this clean. It catches English
speakers outside the US and UK who'd otherwise match nothing — see
regional variants without a generic fallback.x-default catches everyone else — see
missing x-default for what happens without it.en-uk instead of en-gb and the
linter flips to an error pointing at the fix — see code format.Current target
Recent checks appear below. Use the star beside any saved site, page, or list to favorite it.
Target filled from your local choices.
Saved targets, named lists, and recent check summaries remain only in this browser.
Checks run from our server; we fetch the URL you enter and don't keep the results. Anonymous aggregate outcomes feed our research posts; checked domains are counted once via an anonymized hash, never stored in the clear. Anonymous run-level outcome counters may be used for aggregate research; URLs, domains, IPs, and identifiers are never included, and no statistic is released below 100 runs.
Use it when: you control the HTML templates for ordinary web pages.
Usually the clearest choice: render the full same cluster in every page head.
Use it when: templates are hard to change or you manage many URL variants centrally.
Use xhtml:link entries consistently and keep the sitemap accessible to crawlers.
Use it when: the alternate is a PDF or another non-HTML resource.
This is the practical option for files that have no HTML head. Avoid mixing methods without a reason.
hreflang tells search engines which language/region versions of a page exist so each
searcher gets the right one. Three delivery methods are equivalent: <link
rel="alternate"> tags in the <head>, xhtml:link
entries in an XML sitemap, or HTTP Link headers (the only option for PDFs
and other non-HTML files). Pick one method per page — mixing them invites conflicts.
The two rules that break most implementations: every page must include a self-referencing entry, and every pair must be bidirectional — if A lists B, B must list A back or the pair is ignored. Because this generator emits the complete cluster on every page, both hold automatically.
If you publish en-US and en-GB but no plain en,
English speakers in Australia, Ireland, or India match nothing and Google picks for
them. Add a generic en entry (it can point at whichever regional page you
treat as the default).
x-default names the page for users who match no declared locale —
typically your language selector or your primary version. It's optional, and this tool
only warns about it, but explicit beats letting the algorithm choose.
A standalone language-selector page needs the annotations too: place the same head-tag
block on it — the x-default line is its self-reference, so the cluster
stays bidirectional. In the sitemap output, a selector URL that isn't one of the locale
pages automatically gets its own annotated <url> entry.
x-default is also a per-page annotation: pages in the same cluster may point at different x-defaults — the French page at a French-language selector, the English page at an English one. Use the per-row x-default column for that; when pages differ, the head-tag and Link-header output switches to one block per page, and each distinct selector gets its own annotated sitemap entry.
hreflang URLs must match the canonical URL exactly. If half your entries say
http:// or drop the trailing slash your site redirects to, those alternates
point through redirects — Google often discards them. Use the final, canonical form of
every URL.
A few ISO 639-1 codes were renamed and linger in old CMS exports: in →
id (Indonesian), iw → he (Hebrew),
ji → yi (Yiddish). Search engines mostly tolerate the old
forms, but use the modern codes.
Values are language or language-REGION: ISO 639-1 language
(two letters) plus optional ISO 3166-1 alpha-2 region. The classic trap is
en-uk — the United Kingdom's region code is GB. Script
subtags like zh-Hant / zh-Hans are also valid. Underscores
(en_US) are not. Matching is case-insensitive, so casing is cosmetic.
Search the ISO 639-1 language and ISO 3166-1 region codes the generator accepts. Deprecated language aliases are shown with their replacement.
Any of the three, and they are equivalent — but pick one method per page. Use <link rel="alternate"> tags in the HTML head, xhtml:link entries in an XML sitemap, or an HTTP Link header (the only option for non-HTML files like PDFs). Mixing methods on the same page invites conflicts.
x-defaultx-default is the reserved hreflang value that points to a fallback URL — the page Google shows when a user's locale doesn't match any of your other hreflang tags. It is optional and does not mean "English." names the page to serve users who match none of your declared locales — typically a language selector or your primary version. It is optional, but explicit is better than letting the algorithm choose, so it is recommended for most sites.
Almost always one of three things: the annotations are not bidirectional (page A lists B but B does not list A back), a page is missing its self-referencing entry, or the URLs do not match the canonical form (http vs https, or a trailing slashA trailing slash is the forward slash (/) at the end of a URL — example.com/page/ versus example.com/page. Except at the bare root domain, the two versions are different URLs to search engines, so you pick one format and enforce it. your site redirects) so they point through redirects. This generator emits the complete bidirectional cluster with self-references to prevent the first two.
They must agree. Each language version should have a self-referential canonical (pointing to itself, not to another language), and every hreflang URLHreflang is an annotation (in HTML, HTTP headers, or XML sitemaps) that tells search engines which language and optional region a page targets, and which alternate versions exist. It only works when every page in the cluster references all the others. must be the canonical form of that page. A hreflang that points at a non-canonical or redirecting URL is frequently dropped.
No. The region code for the United Kingdom is GB, so use en-gb. hreflang values are an ISO 639-1 language code plus an optional ISO 3166-1 alpha-2 region code; en-uk is the single most common mistake.
Upvote what you want most. New ideas can be submitted from the floating Feedback menu; requests appear here once approved, and the most-wanted rise to the top.
You won't be emailed about that request anymore.
Loading…
New requests are reviewed before they appear here.