OneWebDesk

hreflang Tag Generator

Generate hreflang link tags for multilingual pages.

If you serve the same content in multiple languages or regions, you need hreflang tags to tell search engines “the other language versions of this page live here.” This generator takes a language code and URL per row and produces a block of <link rel="alternate"> tags you can paste straight into your page <head>.

Everything runs in your browser and nothing is sent to any server. Add an x-default row to point unmatched visitors at a fallback page, and the tool warns you if you enter the same code twice.

Enter at least one row with a code and URL to generate hreflang tags.

What hreflang is and when to use it

hreflang tells search engines about the language/region alternates of the same content. It helps show Korean speakers the Korean page and US-English speakers the en-US page, reducing duplicate content issues and serving localized results. Use a bare ISO 639-1 language code (ko, en, ja) or a language-region form (en-US, pt-BR, zh-Hant).

Reciprocal links are required

The most important rule is that hreflang must be reciprocal. If page A points to B as an alternate, page B must point back to A (and to the whole set, including itself). If only one side declares the relationship, search engines distrust and ignore the entire cluster. In practice the safest approach is to have every language version share the exact same hreflang block. That means each page's <head> contains:

  • A hreflang link for every language version, including itself.
  • (Optional) one x-default link.

x-default and why absolute URLs

x-defaultmarks the fallback page for visitors who don't explicitly match any language/region. It usually points to a language-selection screen or a global English page. It is optional but recommended because it lets you control the unmatched experience.

Always use an absolute URL in href (a full address starting with https://). Relative paths do not work for hreflang, and each URL should match that page's canonical URL exactly — same protocol, domain, and trailing slash.

  1. Add one row per language/region with its code and absolute URL.
  2. Optionally add an x-default row for the fallback page.
  3. Copy the generated <link> block into the <head> of every version, identically.

After inserting it, use the SEO meta tag checkerto confirm each page's canonical and hreflang made it into the actual HTML as intended.

Frequently asked questions

How do I write the hreflang code?
Use an ISO 639-1 code for language only (ko, en, ja), or a language-region form to distinguish regions (en-US, pt-BR). Case is ignored, but by convention language is lowercase and region is uppercase.
Do I have to include x-default?
No, it's optional. But it's recommended because it lets you set a fallback page for visitors whose language/region doesn't match any row — typically a language-selection page or a global English page.
Why should every page share the same block?
hreflang is reciprocal by design. Each page must declare the full set of alternates including itself, identically, so search engines trust the cluster. A one-sided declaration may be ignored.
Can I use relative paths?
It's not recommended. Always use absolute URLs starting with https in href, and match each page's canonical URL exactly.
Are my URLs sent to a server?
No. Tag generation happens entirely in your browser and no data is transmitted anywhere.

Related tools

SEO / Indexing