Generate hreflang link tags for multilingual and regional pages.
Generated locally in your browser.
How do you generate hreflang tags?
Each language–URL pair becomes a tag: <link rel="alternate" hreflang="lang-REGION" href="URL" />. Every page in the set should list all the alternates, including itself, so annotations are reciprocal. An x-default covers languages you have not specified. For example, en-us and fr-fr URLs produce two alternate link tags plus an optional x-default.
Understanding your result
Hreflang annotations help search engines serve the right language or regional page to each user. They must be reciprocal — every page references all versions, including itself — and an x-default covers languages you have not specified.
Formula and method
Each pair becomes a tag: <link rel="alternate" hreflang="lang-REGION" href="URL" />. Every page in the set should list all the alternates, including itself.
Assumptions and limitations
This generator builds the correct hreflang link tags from the language-URL pairs you supply, but it cannot verify that every page actually references all the others. Hreflang must be reciprocal to work, so you still need to place the full set on each page. It does not crawl your site or check that the URLs resolve.
Worked example
en-us and fr-fr URLs produce two alternate link tags, plus an x-default if you add one.
How to use this tool
- Enter each language code and its URL on a line.
- Optionally add an x-default URL.
- Copy the tags into your page head.
Common mistakes to avoid
- Using non-reciprocal tags that omit some versions.
- Using an invalid or made-up language or region code.
About the Hreflang Tag Generator
The Hreflang Tag Generator builds the hreflang link tags that tell search engines which language and regional version of a page to show. Enter your language–URL pairs and copy the tags into your page head.
Who should use this tool
SEOs and developers running multilingual or multi-region websites.
Benefits
- Valid hreflang link tags in seconds.
- Optional x-default fallback tag.
- Accepts language or language-region codes.
- Copy or download the markup.
Practical use cases
- Setting up international SEO for a site.
- Adding regional variants (en-us, en-gb).
- Providing an x-default for unmatched languages.
Explore all SEO and Website Tools tools
Frequently asked questions
What is x-default?
A fallback hreflang value pointing to the page shown when no other language or region matches the user.
Where do hreflang tags go?
In the <head> of each page in the set, or alternatively in the XML sitemap or HTTP headers. They must reference every version, including the page itself.
What language and region codes should I use?
Use a valid two-letter language code, optionally followed by a region, such as en for English or en-us for English in the United States. The language comes first and the region is a country code. Add an x-default entry to catch any language you have not specified.