Hreflang Generator

Build hreflang tags or sitemap alternates, with a check for the mistakes that silently break them.

Language versions
x-default

x-default is the fallback for visitors whose language you do not have a version for.

<link rel="alternate" hreflang="en" href="https://example.com/en/page" />
<link rel="alternate" hreflang="tr" href="https://example.com/tr/sayfa" />
<link rel="alternate" hreflang="x-default" href="https://example.com/en/page" />

Every version must point back at all the others, itself included. A one-way reference is ignored, which is the most common reason hreflang does nothing.

How to Set Up Hreflang

1

List every version

Add one row per language version of the same page, with its code and its absolute URL. A language code such as tr, or a language and region pair such as en-GB.

2

Set an x-default

This is where visitors go when none of your versions match their language. A global English page or a language picker are both reasonable choices.

3

Add the output to every version

The set is the same on all of them, including the reference to itself. This reciprocity is required, and missing it is the usual reason hreflang quietly does nothing.

Features

HTML link tags and XML sitemap alternates
Self-referencing entries included automatically
x-default support
Validation for duplicate codes and malformed language codes
Warning when a URL is relative rather than absolute
Warning when only one version is listed
Runs entirely in your browser
Free with no sign-up

Frequently Asked Questions

It tells search engines that several URLs are the same page in different languages or regions, so the right one is shown to the right visitor. It does not affect ranking, it affects which version appears.

Almost always because the references are not reciprocal. Every version must list all the versions, including itself. If page A points to B but B does not point back, the whole set is ignored.

It is optional but recommended. It catches every visitor whose language you have no version for, and without it those visitors are matched by the search engine's own guess.

Language alone unless the region genuinely matters. Use en-GB and en-US only if the content actually differs, such as pricing or shipping. Otherwise plain en is simpler and safer.

Any one of them, but only one. Tags are simplest for a few pages, a sitemap is far easier to maintain at scale, and headers exist for non-HTML files such as PDFs.

It helps search engines understand that similar pages in different languages are intentional, but it is not a canonical tag. Keep self-referencing canonicals on each version as well.

tr, and tr-TR if you also serve a different Turkish version elsewhere. For most sites plain tr is correct.

Yes, completely free with no sign-up.

Need a Custom Tool or Application?

We build production-grade web applications, SaaS platforms, and developer tools. Let's talk about your project.

or book a free call