Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

Hreflang Generator

Generate hreflang link tags from locale and URL pairs, with locale-format validation, duplicate detection, and x-default support.

Processed locally in your browser — nothing is uploaded.

LocaleURLRemove

hreflang tags

Output appears here…

Remember: hreflang must be reciprocal. Every URL listed here needs the same set of tags in its own <head>, or search engines ignore the annotations.

About Hreflang Generator

Enter one row per language version and get the matching <link rel="alternate" hreflang> tags for the page's head. Locale codes are checked against BCP 47's common shapes — a bare language (en), language plus region (en-GB), or language plus script (zh-Hans) — and normalised to conventional casing.

Duplicate locales are the most common hreflang mistake after missing reciprocity, so any locale used twice is reported with the row numbers involved. The optional x-default entry tells search engines which URL to serve when no listed language matches the visitor.

Common uses

  • Add language annotations to a page that exists in several markets
  • Debug a locale code that Search Console flagged as invalid
  • Add an x-default fallback to an existing set of hreflang tags

Example

Input

en → https://example.com/ · de → https://example.com/de/

Output

<link rel="alternate" hreflang="en" href="https://example.com/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />

Limitations

  • hreflang must be reciprocal: every URL listed here needs the same complete set of tags in its own head, or the annotations are ignored
  • Region codes are checked for shape only — that a code is well-formed does not mean it is the right market for your page
  • hreflang is a signal for which version to show, not a ranking factor or a substitute for translated content