Hreflang Generator
Create valid hreflang tags for language variants.
Use the Hreflang Generator tool
What this hreflang generator does
Hreflang tells search engines which page to serve to a user in a given language and region. The generator builds the `<link rel="alternate" hreflang="…" href="…">` block from rows you add, checking that each code looks like a valid language tag.
Language codes are ISO 639-1 (two letters, such as `en`), and region codes are ISO 3166-1 alpha-2 (two letters, such as `gb`). A value like `en-GB` means English for the United Kingdom; `en` alone means English with no regional preference.
Why use it
- Add correct annotations to a multilingual site.
- Avoid invalid region codes that search engines ignore.
- Ensure an x-default page exists for unmatched languages.
How to use it
- 1Add one row per language or region variant.
- 2Enter the language tag and the absolute URL of that version.
- 3Keep x-default enabled and copy the generated tags into every variant's head.
Worked examples
Two variants
Input
en-GB → https://example.com/uk/ · en-US → https://example.com/us/
Output
Two alternate link tags plus an x-default pointing at your chosen fallback.
Language only
Input
de → https://example.com/de/
Output
hreflang="de" is valid and targets German speakers in any region.
Common mistakes
- Adding hreflang tags to only one variant; every version must reference the full set, including itself.
- Using a country code as the language, such as `uk` instead of `en-GB`.
- Pointing variants at redirected or noindexed URLs.
Frequently asked questions
Is x-default required?
Should each page list itself?
Does hreflang improve rankings?
Related tools
All toolsSitemap Generator
Create a valid XML sitemap from a URL list.
Meta Tag Analyzer
Audit the head of a page for SEO and sharing tags.
robots.txt Generator
Write valid crawl rules without syntax mistakes.
SERP Snippet Preview
Preview how a search result will look.