quialo.

Hreflang Tag Generator

Row 1 needs a URL.

Hreflang tags tell search engines which version of a page to show for each language or region. Enter a code and URL for every page, add an optional x-default for everyone else, and this tool builds the block of link rel alternate tags for you to paste into the head of each page. Everything runs in your browser, so your URLs never leave your device.

How to use

  1. Enter a language or region code in the first field, for example en, fr, or en-US.
  2. Paste the full URL for that version of the page in the second field.
  3. Click Add row to include more languages or regions, one pair per row.
  4. Optionally set an x-default URL for users whose language is not listed.
  5. Click Copy and paste the generated tags into the head of every listed page.

Examples

  • Codes en and fr with URLs https://example.com/ and https://example.com/fr/ produce two link tags: one with hreflang en and one with hreflang fr.
  • Adding an x-default URL of https://example.com/ appends a third tag with hreflang x-default at the end of the block.
  • Region targeting works too: en-US and en-GB pointing at https://example.com/us/ and https://example.com/uk/ create separate tags for each market.

FAQs

What is the x-default tag for?
The x-default tag points to a fallback page for users whose language or region does not match any of your listed versions. It is commonly used for a language selector or a global home page.
Do I need to put these tags on every page?
Yes. Each page in a set of alternates should list the full group, including a self referencing tag for its own language. Place the complete block in the head of every URL you listed.
What format should the codes use?
Use an ISO 639-1 language code on its own (en, de, fr) or a language plus an ISO 3166-1 region (en-US, pt-BR). Codes are not case sensitive in hreflang, but lowercase language with uppercase region is the common convention.
Should the URLs be absolute?
Yes. Always use full absolute URLs including the protocol, for example https://example.com/fr/. Relative URLs are not valid in hreflang attributes.
Why does the tool reject a duplicate code?
Each language or region code should appear only once in a set. A repeated code is ambiguous to search engines, so the tool flags it so you can fix the conflict before publishing.

Related tools