Hreflang Tag Generator
Generate hreflang link tags for every language and region version of a page, with an optional x-default. Checks URL and code format, flags duplicates, previews the entries and exports the tags as HTML.
Generate hreflang link tags for every language and region version of a page, with an optional x-default. Checks URL and code format, flags duplicates, previews the entries and exports the tags as HTML.
Hreflang Tag Generator builds the <link rel="alternate" hreflang="…" href="…"> tags that tell search engines which language or regional version of a page to show. Add a row for each version with a language code, an optional region code and the page URL, add an optional x-default URL for users who match none of them, and the tool produces a clean, correctly escaped block of tags ready to paste into the <head> of each page.
Each entry is checked locally: language codes must be 2 or 3 letters, region codes 2 letters, and URLs absolute http or https addresses. Duplicate hreflang values are reported as errors, and one URL used for several hreflang values is flagged for review. These are format checks only — they do not confirm that a code is an official language or region code. Generating tags does not guarantee that search engines will use them: every page in the set must carry the full, reciprocal set of tags, and deploying them is up to the site owner.
A language code of 2 or 3 letters (for example en, fr, hi), optionally followed by a 2-letter region code (for example en-GB or es-MX). The tool writes language in lower case and region in upper case.
No. It checks the shape of the code only. Make sure you use ISO 639-1 language codes and ISO 3166-1 alpha-2 region codes — for example the United Kingdom is GB, not UK.
x-default marks the page to show when no other version matches the user’s language or region, such as a language selector or a global home page. It is optional.
Several hreflang values can point to the same page if that page genuinely serves all of them, for example one English page for en-GB and en-IE. The tool flags it so you can confirm it is intentional. Duplicate hreflang values, however, are errors.
In the <head> of every page in the set. The same complete block, including each page’s own entry, should appear on all of them. Hreflang can also be provided in HTTP headers or sitemaps, which this tool does not generate.
No. Tags are hints. Search engines may ignore them if they are not reciprocal, point to non-canonical or broken URLs, or conflict with other signals.