Hreflang tag generator

Enter equivalent page URLs and language or region codes. Generate reciprocal hreflang tags with an optional x-default version for review.

Processed in your browser: your data are not uploaded.

Set your data

Set your data

Enter ISO 639-1 language, optional ISO 3166-1 alpha-2 region and absolute URL per line. Examples: en, it-IT, pt-BR. Output is one reciprocal block for every version.

Result

Your result will appear here.

We count which tools are used most, without including entered values or file contents in the statistics. Privacy

How to use the tool

  1. On each line, enter the ISO 639-1 language code, optional ISO 3166-1 alpha-2 region, and URL.
  2. You can enter the domain with or without www and include a path and query. HTTPS is used when the scheme is omitted.
  3. Examples: en, it-IT, pt-BR.
  4. Output is one reciprocal block for every version.

Method and principles

Place the same block on all equivalent versions, including the current page.

Tags do not create translations or check that URLs exist.

Practical example

Input
  • One language code and URL per line: en https://example.com/en it https://example.com/it
  • x-default URL (optional): https://example.com/en
Result
<link rel="alternate" hreflang="en" href="https://example.com/en"> <link rel="alternate" hreflang="it" href="https://example.com/it"> <link rel="alternate" hreflang="x-default" href="https://example.com/en">

Limits and checks

Limits and checks
ParameterValue
One language code and URL per line≤ 5000000 characters

Sources and further reading

Favorites