Skip to content
tecuy
SEO & Webmaster

Hreflang Generator & Validator

Generate hreflang alternate-link tags for multi-language pages, with local validation for duplicates, code shape, and an x-default fallback.

What this checks — and what it can't

Language/region codes are checked for structural shape only (e.g. "en" or "en-US") — this tool doesn't maintain (or invent) a full list of real, assigned language and region codes. It also cannot verify that the pages you've listed actually link back to each other, since it never fetches any live page — reciprocal hreflang is something search engines expect, and you'll need to confirm it yourself on the actual live pages.

Generated entirely in your browser — nothing you enter here is sent to a server, and no page is fetched.

Generate <link rel="alternate" hreflang="..."> tags for a set of language/region alternates of the same page, including an x-default fallback. Language/region codes are checked for structural shape (e.g. "en-US"), not against a maintained list of every real assigned code.

Search engines expect hreflang to be reciprocal — each alternate page should link back to all the others. This tool can't verify that for you, since it never fetches your live pages; check reciprocity yourself before relying on this markup.

How to use the Hreflang Generator & Validator

  1. In each row, enter a language/region code (for example en, en-US, or x-default) and the full URL of that version.
  2. Click Add another alternate for more versions; rows can be removed once there are more than two.
  3. Click Generate and fix any errors listed.
  4. Read the warnings, then click Copy to copy the generated link tags.

Example: US English, German, and a fallback

Enter en-us with https://example.com/en/, DE with https://example.com/de/, and x-default with https://example.com/. Generate outputs three tags, starting with <link rel="alternate" hreflang="en-US" href="https://example.com/en/" />, with the codes normalized to en-US and de.

Questions about the Hreflang Generator & Validator

Why is en_US rejected?
Subtags must be separated with a hyphen, as in en-US. Underscores do not match the accepted language, language-Script, or language-Region shapes.
Does it change the case of my codes?
Yes. The language is lowercased, a 4-letter script is title-cased, and a 2-letter region is uppercased, so ZH-hant-tw becomes zh-Hant-TW in the output.
Where do the tags go?
In the head of every page in the set, including the page itself, so each version lists itself and all its alternates. The tool only outputs HTML link tags, not sitemap or HTTP header formats.
Can I use relative URLs?
No. Each URL must be an absolute http or https URL, and URLs containing a username or password are rejected.