Free browser tool

hreflang tag generator

Generate hreflang and x-default tags from language-code and URL pairs.

Input and settings

How to use it

Generate alternate-language link tags from language-code and absolute-URL pairs, with an optional x-default URL.

  1. Enter one language=https://... pair per line.
  2. Optionally enter an x-default URL.
  3. Select Generate and copy the resulting <link rel="alternate"> tags.
Line format
language-code=https://absolute-url
URL schemes
http or https
x-default
Optional
Extra helper
Checks duplicate language codes and duplicate URLs

ja and en become two alternate tags

ja=https://example.com/ and en=https://example.com/en/ produce separate hreflang link elements; an x-default line is added when supplied.

The generator checks a simple language-code pattern, not full BCP 47 correctness or reciprocal hreflang implementation across live pages.

Each row must match code=URL

Rows that do not match the expected pattern stop generation with an error rather than being silently skipped.

URLs are required to be absolute http(s) URLs

The input pattern expects a full http:// or https:// destination, not a relative path.

x-default is generated separately

When provided, x-default can point to a locale selector or fallback page for users who do not match a listed language/region.

Correct hreflang deployment is site-wide, not just tag generation

Search engines generally expect alternate pages to reference one another consistently. Generated tags are only one part of that implementation.