Hreflang tag generator

Build hreflang tags for a set of language and region URLs, with x-default.

FreeRuns in your browserNo signupUpdated 2026-10-29

Every page in the set must carry the full list, including itself. Each language URL should also point to itself as canonical.

Versions

5

+ x-default → en · 0 duplicates dropped

Status

Valid set

Codes and URLs look right

head.html
<link rel="alternate" hreflang="en" href="https://www.example.com/" />
<link rel="alternate" hreflang="en-gb" href="https://www.example.com/uk/" />
<link rel="alternate" hreflang="ar-ae" href="https://www.example.com/ae/ar/" />
<link rel="alternate" hreflang="en-ae" href="https://www.example.com/ae/" />
<link rel="alternate" hreflang="hi-in" href="https://www.example.com/in/hi/" />
<link rel="alternate" hreflang="x-default" href="https://www.example.com/" />

Paste the same block on every page in the set

  • en https://www.example.com/
  • en-gb https://www.example.com/uk/
  • ar-ae https://www.example.com/ae/ar/
  • en-ae https://www.example.com/ae/
  • hi-in https://www.example.com/in/hi/

About this tool

How it works and how to read the result.

Need this done for you?

Arabic & multilingual websites

English and Arabic websites with proper right-to-left layouts.

See the service

What it does

An hreflang generator writes the alternate-language link tags that tell Google which version of a page to show in each country and language. Paste each language code and its URL, choose the x-default, and get the tags as HTML for the head, as an HTTP Link header for PDFs, or as sitemap entries for large sites. Codes are checked against the ISO language and region format, so a stray "ae" or "english" is flagged rather than published.

How to use it

  1. Enter one line per version as "code | URL", for example "ar-ae | https://example.com/ae/ar/".
  2. Pick which version should be the x-default fallback.
  3. Choose HTML link tags unless you need headers or sitemap XML.
  4. Copy the output and paste the same block into the head of every page in the set.
  5. Repeat for each page template, swapping in that page's URLs.

How to read the result

The Versions stat counts valid lines. Five lines with English, British English, Gulf Arabic, Gulf English and Hindi gives "5", with the hint showing that x-default points at the first one. The Status badge is green for a valid set. A line such as "arabic | https://example.com/ar/" is skipped and the badge turns amber, because "arabic" is not an ISO code; change it to "ar".

In the HTML output there are six link tags: one per version plus x-default, which repeats the fallback URL with the hreflang value "x-default". A set with two versions produces three tags. The sitemap output repeats the full list under every URL, which is why sitemap files for multilingual sites grow quickly.

If the same code appears twice, the second is dropped and the hint shows "1 duplicate dropped". Fix the source rather than relying on that, since two URLs claiming the same language is itself a mistake.

Multilingual builds with correct hreflang on every template are what our Arabic and multilingual websites service delivers. Pair the tags with a canonical tag on each version.

Questions

Frequently asked.

What is x-default for?

It names the page to show visitors whose language or country matches none of your versions. Usually that is the English page or a language-chooser page. It is optional, but Google recommends it, and without it those visitors get whichever version Google guesses, which is often wrong.

Do the tags need to be on every language version?

Yes. Hreflang only counts when the pages confirm each other. If the English page points to the Arabic one but the Arabic page does not point back, Google ignores both links. Every page in the set carries the identical list, including a link to itself.

Should I use ar or ar-ae?

Use the plain language code unless you have different content for different countries. One Arabic page for all Arabic readers is "ar". Separate pages for the UAE and Saudi Arabia are "ar-ae" and "ar-sa". Never use a region without a language, so "ae" on its own is invalid.

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

We reply within a working day. No spam, ever.