Hreflang tag generator and checker

Turn a list of URLs and languages into correct hreflang tags, then check that every page links back to the others.

Free to use, no sign-up.

Loading the tool…

How it works

  1. Paste one page per line as a language code and a full URL (for example en-US https://example.com/). Put a blank line between different pages if you are doing several at once.
  2. The generator checks every language and region code against the ISO lists, then writes the full set of tags for each page, including the self-reference and an optional x-default. Choose HTML tags, HTTP Link headers or a sitemap with xhtml:link entries.
  3. To audit a live setup, switch to Check existing tags and paste the tags from each page. The checker reports missing return links, missing self-references, invalid codes and conflicting duplicates.

Questions

What is a hreflang return link and why does it matter?

If page A says page B is its French version, page B must also say page A is its English version. Google ignores hreflang annotations that are not confirmed from both sides. Missing return links are the most common reason hreflang does nothing.

What format do language and region codes use?

A language code from ISO 639-1 (en, fr, ja), optionally followed by a region from ISO 3166-1 alpha-2 (en-GB, fr-CA). You cannot use a region on its own, and the region is not the same as the language: use ja for Japanese, not jp, and en-GB for the United Kingdom, not en-UK.

What is x-default?

x-default marks the page to show when none of your languages match the visitor, such as a language selector or your main version. It is optional, but recommended. It can point to the same URL as one of your languages.

Should I use HTML tags, HTTP headers or a sitemap?

All three are valid, and you should pick one method per page set rather than mixing them. HTML tags in the head work for most sites. HTTP headers are the only option for non-HTML files such as PDFs. A sitemap suits large sites because the annotations live in one file.

Does this tool fetch my pages?

No. It only works on the text you paste, in your browser. Nothing is uploaded and no pages are crawled, so to check live pages you copy their tags in yourself. We only count that the tool was used so we know which free tools are worth maintaining.