Hreflang Generator
Hreflang Generator builds the alternate-language annotations Google uses, in your browser.
Language alternatives
- No x-default entry. Adding one is recommended so unmatched users get a fallback page.
Each alternate page should return the same hreflang set. This tool works from a single set on your device and cannot check that other pages link back — that needs a crawl.
<link rel="alternate" hreflang="en" href="https://example.com/"> <link rel="alternate" hreflang="fr" href="https://example.com/fr/">
How to use it
- Add one row per language version with its hreflang value and absolute URL
- Review the per-row and set-level errors and warnings
- Optionally set the current page URL and turn on the XML sitemap snippet
- Copy the HTML tags, copy the XML snippet, or download the CSV checklist
Add one row per language version — a hreflang value and its absolute URL — and the tool validates each one: hreflang syntax (a language code like en, a language-REGION code like en-US, or x-default) and http:// or https:// URLs only. Values are normalised to lowercase language and uppercase region, so EN-us becomes en-US; a plainly invalid value is never guessed at. Local checks flag duplicate hreflang values and more than one x-default as errors, and surface warnings for a missing x-default, a URL reused for several languages, only one alternate, a #fragment, or mixed schemes and hosts. An optional Current page URL field checks that the page references itself. It generates the <link rel="alternate"> tags in your row order, an optional XML sitemap snippet with the xhtml namespace note, and a CSV checklist. It cannot confirm that the other pages return the same hreflang set — that needs a crawl — so it only offers guidance, and it never fetches anything. Unlike the Meta Tag Generator, which produces title and description tags, and unlike a sitemap generator, which lists a site's URLs, this tool only describes the relationships between one page's language versions. Everything runs locally; your URLs are never sent anywhere.
FAQ
hreflang tells search engines that a page has equivalent versions for other languages or regions, so a French user can be shown the French URL rather than the English one. It is a hint about relationships between pages, not a redirect.
Yes. A well-formed hreflang set is self-referential: each language version lists all the alternates, including itself. Set the current page URL field and the tool warns if that URL is missing from the entries.
x-default marks the URL to show users whose language or region is not covered by the other entries — often a language picker or a global homepage. A set can have at most one x-default, and this tool treats a second one as an error.
No. It works from a single set of entries on your device and never fetches other pages. Reciprocity — each alternate returning the same hreflang set — has to be checked with a crawler or in Search Console; the tool only shows guidance.
Yes. Turn on the sitemap snippet to get a <url> block with <xhtml:link> entries. Your <urlset> element needs xmlns:xhtml="http://www.w3.org/1999/xhtml", and the tool includes that note in the output.