Hreflang Tag Generator

Generate valid hreflang link tags for international and multilingual sites — with x-default and ISO code validation.

Free · No sign-up · Instant results

Language / region versions

Version 1hreflang="en-US"
Version 2hreflang="es"

Generated hreflang tags

Fill in a language and URL for each version to generate hreflang tags…

Add this complete set to the <head> of every page in the cluster — including return tags pointing back to each version.

Why use a hreflang generator?

Valid Codes

Pick languages from ISO 639-1 and regions from ISO 3166-1 dropdowns — no typos, no invalid codes.

x-default Built In

Toggle the x-default fallback tag so users outside your target locales still land on the right page.

Catches Mistakes

Warns about duplicate language/region pairs and invalid URLs before they break your international SEO.

How to use the hreflang generator

  1. 1

    Add a row per language version

    Pick the language and, if you target a specific country, the region. The hreflang value builds automatically.

  2. 2

    Paste each absolute page URL

    Enter the full https URL for that language/region version. Relative URLs are invalid for hreflang.

  3. 3

    Toggle x-default

    Keep x-default on and set the fallback URL (often a language selector or your global homepage).

  4. 4

    Copy into every page's head

    Click 'Copy' and paste the full set into the <head> of each page in the cluster — return tags included.

Hreflang FAQ

What does the hreflang tag do?

The hreflang attribute tells Google which language and (optionally) regional version of a page to serve to which users. If you have the same content in English, Spanish, and German, hreflang links those versions together so a Spanish searcher sees the Spanish page in results — preventing the wrong-language page from ranking and reducing duplicate-content issues.

What is x-default and do I need it?

x-default is a special hreflang value that points to the fallback page shown to users whose language/region doesn't match any of your specific versions — typically a language selector or your default/global page. It's optional but strongly recommended. Toggle the x-default switch in this tool and set its URL to add the <link rel="alternate" hreflang="x-default"> tag.

What are the most common hreflang errors?

The top three: (1) Missing return tags — every page in the cluster must reference every other page, including itself. (2) Wrong codes — using a country code where a language code is expected (e.g. 'uk' for Ukrainian is correct, but 'en-UK' is wrong; it should be 'en-GB'). (3) Relative URLs — hreflang requires absolute, fully-qualified URLs. This tool validates language codes and uses the URLs exactly as you enter them.

What's the correct format for a hreflang value?

Use an ISO 639-1 language code on its own (e.g. 'en', 'fr', 'de'), or a language code plus an ISO 3166-1 Alpha-2 region code separated by a hyphen (e.g. 'en-US', 'pt-BR', 'es-MX'). The language always comes first. Region alone is never valid. This generator builds the value for you from the dropdowns.

Where do I put hreflang tags?

Place the <link rel="alternate" hreflang="..."> tags in the <head> of each page in the cluster. You can also serve them via HTTP headers or an XML sitemap, but the <head> method is the simplest and most common. Remember: every alternate page needs the full set of return tags pointing back.

Related free tools

Audit hreflang across your international site

SEOBolt's international site audit auto-detects missing return tags, invalid codes, and incorrect hreflang clusters across every page. Free for 2 projects.

Run Full Site Audit Free →