Skip to content
TurboIndex

Hreflang Tag Generator

List the language versions of a page and get a validated hreflang block in the format you need.

Output format

How to use the generator

Add one row per version of the page. In the first field enter the language, or the language and country: fr, fr-CA, pt-BR. In the second field enter the full URL of that version. Codes are validated as you type, including the classic mistakes such as en-UK (the country code is GB) and underscores.

Add an x-default row for the page people should get when none of your versions matches them. A language picker or your international English page are the usual choices.

Three output formats

  • HTML link tags go in the <head> of every version listed.
  • XML sitemap output creates one <url> entry per version, each carrying the complete set of xhtml:link alternates. Merge it into your existing sitemap and check the result with the sitemap validator.
  • HTTP Link header is for PDFs and other files without a head section.

Rules that make or break hreflang

Every version must list every other version and itself. URLs must be absolute, return 200 and be the canonical URL of that version. One language and country combination can point to only one URL. After publishing, run the hreflang checker on a live page to confirm the return links.

Google can only pair versions it has crawled. If the new language pages are slow to show up, TurboIndex submits them from your sitemap and tracks when each is indexed.

Questions and answers

Where should hreflang go: HTML, sitemap or header?

All three work the same for Google. HTML tags are the easiest to debug. Sitemaps keep pages light when you have many languages. HTTP headers are the only option for non-HTML files such as PDFs. Use one method per page, not several.

Do I paste the same block on every language version?

Yes. The full set, including the page's own URL, goes on every version. That is what creates the return links Google requires.

What is the difference between en and en-GB?

en targets English speakers everywhere. en-GB targets English speakers in the United Kingdom. You can combine them: regional versions for your main markets plus a generic en page for everyone else.

Does hreflang improve rankings?

Not directly. It swaps the URL shown in results for the version that matches the searcher, which improves click-through and keeps the wrong-language page from showing up.