Pixelquil logoPixelquil

Hreflang Tag Generator & Validator

Generate correct hreflang tags for multi-language pages and validate them for common return-tag errors.

Generate hreflang tags

Add every language/region version of a page. Up to 50 URLs.

One row per URL: url,language,country (country optional)

Validate existing hreflang tags

Fetch a live page or paste HTML to check its hreflang tags, including whether alternate pages return the tag correctly.

Validation report

  • Paste HTML or fetch a URL to validate its hreflang tags.

How it works

  1. 1

    Add each language version

    Enter a URL, language, and optional region for every variant, or upload a CSV of url,language,country rows.

  2. 2

    Mark an x-default if needed

    Optionally check x-default on one URL to set the fallback for unmatched languages.

  3. 3

    Choose an output format

    Generate as HTML link tags for each page's head, or as XML sitemap attributes for the whole set at once.

  4. 4

    Validate existing tags

    Fetch a live URL or paste HTML to check its hreflang tags for formatting errors, duplicates, and a missing self-reference.

  5. 5

    Check return tags

    Run the return-tag check to confirm each alternate page actually links back to the original, not just the other way around.

About the Hreflang Tag Generator & Validator

Hreflang is one of the easiest SEO signals to get technically wrong while looking completely fine, a single broken reciprocal link between two language versions can quietly undermine international targeting for months. This tool generates correct hreflang tags for a set of language and region variants, and validates existing tags for the specific errors that actually cause problems, including checking whether alternate pages link back correctly, not just whether tags are present.

Why return tags are the whole game

Hreflang isn't a one-directional hint, it's a mutual confirmation. If a Spanish page says its English version lives at a certain URL, that English page has to say the Spanish version lives back at the original URL, or the relationship isn't considered valid. This is, by a wide margin, the most common real-world hreflang failure, one page in a set gets updated, redirected, or rebuilt, and the reciprocal link silently breaks while every tag involved still looks syntactically correct. Checking for this requires actually visiting the alternate pages and reading their own tags, which is why this tool includes a dedicated check that fetches each alternate URL and confirms it really does link back.

x-default, and why it's worth including

x-default marks a fallback page to show a visitor whose language or region doesn't match any of the specific variants in the set, a French visitor arriving at a site with only English and Spanish versions, for example. It's optional, not every hreflang set needs one, but leaving it out means that ambiguous case is left entirely to a search engine's own judgment rather than an explicit choice. The generator here treats it as its own distinct option per URL, disabling the language and region fields for that row since x-default is a standalone marker, not a language-region pair.

Two valid ways to implement hreflang

Hreflang can be declared as link tags in each page's own HTML head, or as xhtml:link attributes inside an XML sitemap covering the whole set at once, both are equally valid and search engines treat them the same way. The sitemap approach can be easier to maintain for a large site, since the relationships live in one file rather than being duplicated across every page's head, while the HTML approach is simpler for a small number of pages. This tool generates a complete, valid version of either, including the correct xhtml namespace declaration the sitemap format requires.

What the return-tag check can't cover

Checking return tags means fetching every alternate page individually, which takes real time and is capped at 20 alternates per check to keep it from running indefinitely on an unusually large set, a page with more variants than that will only have its first 20 checked, clearly noted when it happens. A page that blocks automated requests, sits behind authentication, or simply times out will show as unable to be checked rather than as passing or failing, since that's genuinely a different situation from a confirmed broken link.

Runs mostly in your browser

Generating and validating tags from HTML you paste in happens entirely locally. Fetching a URL, and checking return tags on its alternates, does route through this site to retrieve each page's content, since a browser can't otherwise read another site's raw HTML directly. Since hreflang sets and a site's canonical tags need to agree with each other, our Canonical Tag Checker and XML Sitemap Validator are worth checking too, both part of the same Technical SEO collection this tool belongs to.

Frequently asked questions

What is a return tag, and why does it matter so much?

Hreflang requires every page in a set to link back to every other page, including itself. If Page A points to Page B but Page B doesn't point back, the relationship isn't considered valid, this is the most common real-world hreflang error.

Do I need to include x-default?

No, it's optional, but recommended. It sets which page a visitor sees when their language doesn't match any specific variant in the set.

What's the difference between the two output formats?

HTML link tags go in each page's own head; XML sitemap attributes declare the same relationships for the whole set in one sitemap file. Both are equally valid and treated the same way by search engines.

Why is the return-tag check limited to 20 alternates?

Checking return tags means fetching every alternate page individually, which takes real time. The limit keeps checks from running indefinitely on an unusually large set, and it's noted clearly if a set is larger than that.

What does it mean if an alternate page 'could not be checked'?

That page either blocked the request, required authentication, or didn't respond in time, which is different from confirming it's actually missing the return tag. It's reported separately rather than being marked as a failure.

Does the CSV upload support language and country columns?

Yes, each row can be url,language,country, with country optional. A single column of just URLs also works.

Why do I need to enter a Page URL to validate hreflang tags?

The HTML alone doesn't say what URL it's served at, which is needed to check for a self-referencing tag and to run the return-tag check on its alternates. This fills in automatically when fetching a live URL.

Is my page data uploaded anywhere?

Generating and validating pasted HTML happens locally. Fetching a URL or checking return tags does route through this site to retrieve each page's content, since a browser can't read another site's HTML directly otherwise.