Hreflang Tag Generator

Link copied

Generate correct hreflang annotations for a multilingual or multi-regional site without hand-writing them — entirely in your browser. List each language-region code and the URL that serves it, one mapping per line, and the tool builds a clean set of <link rel="alternate" hreflang="…" href="…" /> tags ready to paste into your page <head>. As you type it validates the set the way Google does: it flags malformed hreflang codes, entries missing a URL, duplicate codes, two codes pointing at the same page, and a missing x-default fallback — the catch-all that tells crawlers which page to serve users whose language nobody targeted. Copy the result in one click. Free, fast, and completely private — nothing is uploaded or stored.

Language → URL mapping

One mapping per line: an hreflang code, then the URL, separated by a space, tab, or comma.

Generated hreflang tags

Looks good — no issues found.

How to use

Enter one mapping per line: an hreflang code such as en, en-US, zh-Hans, or x-default, followed by the full URL for that variant, separated by a space, tab, or comma. The hreflang tags rebuild instantly on the right, and any problems — invalid codes, missing URLs, duplicate codes, repeated URLs, or a missing x-default — appear below the output. Fix the flagged lines until the set is clean, then click Copy and paste the tags into the <head> of every page in the language group (each page should reference the whole set, including itself).

Frequently asked questions

What is the x-default hreflang value?
x-default marks the fallback page Google serves to users whose language or region none of your other hreflang entries match. It is typically a language selector or your primary/global homepage. It is not strictly required, but Google strongly recommends including one, which is why this tool warns when your set is missing it.
Do all pages need to reference each other?
Yes. hreflang annotations must be reciprocal and complete: every page in a language group should list the full set of alternates, including a self-referencing tag for itself. If page A points to page B but B does not point back to A, search engines may ignore the annotations. Paste the same generated set into each page in the group, ensuring each one's own URL is present.
Is my mapping sent anywhere?
No. The tags are assembled and validated entirely in your browser as you type. Your language codes and URLs are never transmitted, logged, or stored on any server, and the tool works without an account.