SuperSEOPlus

Website Management Tools

Hreflang Generator and Validator

Hreflang annotations tell search engines which language or regional version of a page to show to which visitors. They are easy to get subtly wrong: a bad code, a missing self-reference, or a page that does not link back. This tool builds the annotations for you as HTML tags, XML sitemap entries or an HTTP header, and checks annotations you paste for invalid codes, duplicates, self-references and return links. It works only on the text you give it. It never visits your website, so it cannot tell you what a crawler would see.

How to use it

  1. Choose “Create hreflang annotations” and list each language version as “code | address”, one per line. Add an optional x-default address.
  2. Pick an output format, fix anything listed under the preview, then copy or download it. Use the same set on every page in the group.
  3. To check what you already have, switch to “Check annotations I already have” and paste a sitemap, or “Page: address” blocks followed by each page’s link tags.

Example

For a site in US English, British English, French and German, the list is en-US | https://example.com/en-us/, en-GB | https://example.com/en-gb/, fr | https://example.com/fr/ and de-DE | https://example.com/de/, with https://example.com/ as x-default. Each of those pages carries all five annotations, including one that points to itself.

The rules the validator applies

  • Codes are language, optional script and optional region, or x-default, written with hyphens.
  • Addresses are full URLs starting with https:// (or http://), not relative paths.
  • Each code appears once per page and points to one address.
  • Every page lists itself as well as the other versions.
  • If page A lists page B, page B must list page A.
  • All pages in a group should carry the same set of annotations.

Common mistakes

  • en-UK instead of en-GB. The country code for the United Kingdom is GB.
  • Underscores, as in en_US.
  • Missing self-reference or return links, which is the most common reason annotations are ignored.
  • Pointing hreflang at a page that redirects, is blocked, or is not the canonical version. Use the final, canonical address of each page. A redirect check and the meta tags analyzer can help you confirm what a page really serves.
  • Using all three methods at once, which can cause conflicts.

Where the output goes

HTML tags go in the <head> of every page in the group. Sitemap entries go in your XML sitemap, which you can build with the XML sitemap generator. The HTTP header form is for non-HTML files. Whichever method you choose, keep it consistent across all versions.

Limits

  • Up to 1,000 language versions per group and 2,000,000 characters of pasted text.
  • Language codes are checked against ISO 639-1 and region codes against ISO 3166-1 alpha-2; script codes against a list of common scripts.
  • Only pasted text is checked. The tool never crawls a site.

Questions

What is hreflang for?

It tells search engines that several pages are versions of the same content in different languages or regions, so the right one can be shown to the right visitor. It does not translate anything, and it is a signal about which version to show, not a ranking boost.

Which format should I use: tags, sitemap or headers?

Use one method for a given set of pages. HTML link tags suit most sites, XML sitemap entries suit large sites where editing page templates is hard, and HTTP headers are for files such as PDFs that have no HTML head. This tool writes all three.

Why do I need return links and a self-reference?

Each version must list all the others and itself, and the links must go both ways. If page A points to page B but B does not point back, search engines can ignore the annotation. The validator checks this across the pages you paste.

What are valid hreflang codes?

A two-letter ISO 639-1 language code, optionally followed by a script and a two-letter ISO 3166-1 country code, such as en, en-GB or zh-Hant-TW, plus the special value x-default. Common mistakes are underscores (en_US), UK instead of GB, EU as a region, and three-letter language codes.

Does this check my live website?

No. It validates only the text you paste. It does not fetch your pages, so it cannot see canonical tags, redirects, status codes or what a crawler would actually find. After you publish, test real pages with a crawler or Search Console.

Do all search engines use hreflang?

Google uses it. Other search engines may use it differently or rely on other signals, such as the page language and content. Treat hreflang as one clear signal, not a guarantee.

Get practical SEO tips by email

Occasional emails with new guides and tools. Confirm by email first; unsubscribe in one click.