Hreflang Generator & Validator

Generate valid rel="alternate" hreflang tags for multilingual and multi-region sites, as HTML, XML sitemap markup, or an HTTP Link header, and validate any live URL's hreflang setup, including reciprocal return-tag checking, ISO language/region codes, x-default and self-reference. Free, instant, no signup.

Getting hreflang right is one of the trickiest parts of international SEO, one wrong code, a missing return tag or a non-absolute URL and Google quietly ignores the whole cluster. This tool does both halves of the job. The generator builds correct rel="alternate" hreflang annotations for every language and region version of a page, as HTML tags, XML sitemap markup or an HTTP Link header, with ISO 639-1 and 3166-1 codes validated as you type. The validator fetches any live URL (or your pasted HTML) and audits its hreflang setup, flagging invalid codes, missing x-default, absent self-references and, with deep validation, non-reciprocal return tags by actually crawling the alternates.

Share
Category
SEO Tools
Includes
7 features
Access
Free · No sign-up
Privacy
Runs in your browser
Hreflang Generator & Validator

Calibrating Hreflang Engine......

Please wait a moment

Overview

What hreflang does, and why it's so easy to get wrong

The hreflang attribute tells search engines which language and regional version of a page to show to which users, so a French speaker in Canada lands on your fr-CA page instead of the fr-FR or English one. It's powerful for international SEO, but unforgiving: the language must be a valid ISO 639-1 code, the optional region a valid ISO 3166-1 Alpha-2 code, every URL must be absolute, each page must reference every version including itself, and, crucially, the references must be reciprocal, if page A points to page B, page B must point back to A. Miss any of these and Google treats the annotations as unreliable and ignores them, which is why 'no return tags' is one of the most common Search Console warnings. This tool exists to make both building and checking hreflang foolproof.

Included

Features

01
Generate hreflang as HTML <link> tags, XML sitemap <xhtml:link>, or HTTP Link header
02
Live ISO 639-1 language and ISO 3166-1 region code validation as you type
03
x-default fallback support and duplicate-code detection
04
Validate any live URL's hreflang implementation via the built-in fetcher
05
Deep validation crawls each alternate to verify reciprocal return tags
06
Checks self-reference, absolute URLs, valid codes, x-default and duplicates
07
Paste raw HTML to validate offline; copy or download the generated markup
How to use

How to use Hreflang Generator & Validator

  1. 01

    Pick generate or validate

    Use the Generator to create hreflang markup for your pages, or the Validator to audit hreflang that already exists on a live URL or in pasted HTML.

  2. 02

    Generate: list your language versions

    Add a row for each version with its page URL, language code and optional region, plus an x-default fallback. Invalid ISO codes are highlighted instantly and duplicate hreflang values are flagged.

  3. 03

    Copy the format you need

    Switch between HTML <link> tags, XML sitemap <xhtml:link> markup or an HTTP Link header, then copy or download it. Remember every page must list all versions including itself.

  4. 04

    Validate: enter a URL

    Paste a live URL (or raw HTML) and run the validator. It reports invalid codes, non-absolute URLs, missing x-default and self-reference, duplicates, and, with deep check on, whether each alternate returns a reciprocal link back.

Use cases

Common use cases

  • -Create hreflang tags for a site serving multiple languages or countries (e.g. en-US, en-GB, es-ES).
  • -Audit why Google Search Console reports 'no return tags' or hreflang errors on your international pages.
  • -Validate a competitor's or your own page's hreflang implementation before or after a migration.
  • -Generate hreflang XML markup to add to your sitemap instead of on-page tags.
  • -Check that every language version self-references and includes an x-default fallback.
  • -Confirm reciprocal return tags exist across all alternates so Google honors the cluster.
Guide

Detailed guide

Generate tags in the exact format you need

hreflang can be declared three ways, and this generator produces all of them from one set of inputs. Choose on-page HTML <link rel="alternate" hreflang="…"> tags for the <head>, XML <xhtml:link> markup to drop into your sitemap (handy when you can't edit every page's head), or an HTTP Link header for non-HTML resources like PDFs. As you add each language version, invalid ISO codes are highlighted and duplicate hreflang values are flagged, so you never ship markup that Google will reject. Add an x-default entry for your language selector or default page and copy or download the result.

Validate a live URL with real reciprocal checking

The validator does more than read tags off a page. Point it at a live URL and it fetches the HTML, extracts every hreflang annotation, and checks each one: is the language/region code valid, is the URL absolute, does the page self-reference, is there an x-default, are there duplicates? Turn on Deep check and it goes further, actually fetching each alternate URL and confirming it links back to the page you started from. That reciprocal 'return tag' check is exactly what Google requires and what most free checkers skip, so it catches the real reason a hreflang cluster is being ignored. You can also paste raw HTML to validate without fetching anything.

FAQ

Frequently asked questions

What is an hreflang tag?+

It's an annotation (rel="alternate" hreflang="…") that tells search engines which language and region a page targets, so users are shown the right version. It can live in the page's HTML head, in an XML sitemap, or in an HTTP header.

Does every page need to reference itself?+

Yes. Each page must include a self-referencing hreflang for its own URL, plus one for every other language/region version. If a page doesn't list itself, or the set isn't reciprocal, Google ignores the annotations.

What does the deep / reciprocal check do?+

When you validate a live URL with deep check on, the tool fetches each alternate URL and confirms it links back to your page. Google requires these 'return tags' to be reciprocal, non-reciprocal links are the usual cause of the 'no return tags' error in Search Console.

Do I need a region code, or is a language enough?+

A language code alone (e.g. 'es') is valid and targets a language everywhere. Add a region (e.g. 'es-MX') only when you serve a specific country differently. The language must be ISO 639-1 and the region ISO 3166-1 Alpha-2, the tool validates both as you type.

What is x-default for?+

x-default specifies a fallback page for users whose language/region doesn't match any of your versions, often a language selector or your primary site. It's recommended but not strictly required.

Should I use HTML tags, sitemap markup, or the HTTP header?+

Any one of them works, don't use several at once for the same URLs. On-page HTML tags are most common; XML sitemap markup is convenient when you can't edit every page's head; the HTTP Link header is for non-HTML files like PDFs. This tool generates all three.

Related tools

Related tools