tomai
Log in
Free · SEO Tools

Hreflang Generator

<link rel="alternate" hreflang> tags for every language version of a page

Quick add
Language versions
Output

Frequently asked questions

What format should a language code be?

A 2–3 letter ISO 639-1 language code, optionally followed by a hyphen and a 2-letter ISO 3166-1 region code — e.g. "en", "pt-BR", "zh-TW". Region alone (without a language) isn't valid.

What does x-default do?

It marks the page search engines should show visitors whose language doesn't match any of your listed hreflang entries — commonly a language-selector page or your default-locale version.

Do hreflang tags need to be reciprocal?

Yes — every page in the set should link to every other page (including itself), or search engines may ignore the annotations. Each page you generate tags for needs the same tag block, just with the current page's URL included.

Rules the generator enforces

Language alternates without the classic mistakes

Region + language combos validate against CLDR conventions, x-default gets set once, and return-tags auto-pair so siblings reference each other.

Quick-add locale buttons

Eleven common codes, en, zh, zh-TW, de, es, fr, hi, ja, ko, pt, and ru, add a language row with one click, while any other code can be typed and validated.

🔒

x-default fallback

An optional x-default URL tells search engines which page to show visitors outside your language list, closing the gap for regions you do not target.

🎯

Code validation built in

Codes are checked against the two-to-three-letter language pattern with an optional region before the tags build, so a mistyped locale never sends users to the wrong page.

Related tools

What Is an Hreflang Generator?

For a site with several language or region versions of the same page, hreflang tags tell search engines which version to show to which audience — German searchers get the German page, US users the US page. The tags are link rel alternate hreflang elements placed in the page head. Writing them for a dozen locales is repetitive, and an omitted or mistyped code silently hurts the wrong audience. This generator builds the tag block from a list of language and URL pairs, with quick buttons for common locale codes, so multilingual site owners can assemble the block in seconds.

Tags it assembles

  • 🌍 Quick-add buttons for common locale codes
  • ✍️ Custom language codes, validated against the en-US pattern
  • 🔗 One tag per language version, linking code to URL
  • 🎯 Optional x-default fallback for unmatched languages
  • 📋 Copy or download the complete tag block

Situations that call for it

  • Launching a site in several languages at once
  • Adding a new locale to an existing multilingual site
  • Fixing Google showing the wrong-language version of a page
  • Moving a site to region-specific URLs and keeping tags in sync

Tags are assembled locally in your browser; nothing is uploaded. The rule to remember: hreflang must be reciprocal — every language version needs tags pointing back at all the others, so add the generated block to each version's head, not just one.

Related tools