Sign in Start free

Hreflang Tag Generator

Build reciprocal hreflang tags for every language version of a page, and catch the code mistakes that quietly break them.

Instant No signup Reciprocal by design
LANGUAGES ON THIS PAGE

  

What it checks

  • Builds one alternate URL per language from the address you enter, using a folder (/fr/path), a subdomain (fr.site.com) or a ?lang= parameter.
  • With the folder and subdomain patterns, treats the first language in your list as the default and gives it no language prefix.
  • Flags duplicate codes and any code that is not a two-letter lowercase language, optionally followed by a two-letter region such as pt-BR.
  • Warns when fewer than two versions are listed, because a single hreflang tag has nothing to point to.
  • Adds an optional x-default line that points at whichever listed version you choose.
  • Outputs the set as <link> tags for the page head or as a <url> block with xhtml:link lines for an XML sitemap.

Reading the result

The notes under the buttons are of two kinds: problems with your list, such as a duplicate or invalid code or too few versions, and reminders. Clear the problems before you copy anything, since search engines ignore lines with codes they cannot read.

The tool predicts each URL from the pattern you chose; it does not visit them. Open a few of the generated addresses before you ship. If one returns a 404 or redirects, correct it in the output or fix the page, because an alternate that points at a missing or redirecting page is ignored.

Put the same block in the head of every language version, including the page it describes. The sitemap view gives the <url> entry for the first language only: repeat it for each version with that version's address in <loc>, and make sure your <urlset> declares the xhtml namespace. You only need one of the two methods, which leaves a single place to keep up to date.

Questions

Does the generator check my live pages?

No. It runs in your browser and builds the tags from the URL and codes you enter. It does not fetch your pages, so it cannot tell whether each version exists or already carries matching tags.

What should x-default point to?

The version for visitors whose language matches none of your codes, usually your main language. If you have a separate page where visitors pick a language, change the x-default href to that page after copying.

Which language codes does it accept?

A two-letter ISO 639-1 language code in lowercase, optionally followed by a two-letter region: en, fr or pt-BR. It flags other forms such as zh-Hant even though some are valid, so check those against Google's hreflang documentation.

Do I need hreflang on a site with one language?

No. hreflang describes the language or regional versions of the same page, so with one version there is nothing to point to.

OR STOP DOING IT BY HAND

This checks one page, once. Your crew checks every page, every week, and fixes what it finds.

Add your site - free