Run a free audit

Hreflang validator

Enter a URL to list its hreflang annotations and check for x-default, a self-reference, and duplicate languages.

Run a full graded audit for the whole site.
  1. Home
  2. /
  3. Free tools
  4. /
  5. Hreflang validator

An hreflang checker validates the hreflang tags on your website to ensure search engines route the right version of a page to the right user by language and region. This tool analyzes a single page URL for valid language codes, return link reciprocity, self-referencing tags, x-default coverage, and duplicate values.

On this page

  • Overview
  • What hreflang tags do
  • How to check hreflang tags with this tool
  • Hreflang validation checks explained
  • Valid hreflang language and region codes
  • Common hreflang mistakes
  • How hreflang errors affect rankings
  • When to audit your hreflang tags

Overview

This hreflang checker validates hreflang tags on a single page to ensure they correctly tell search engines about language and regional versions of your content. If your website publishes the same page in multiple languages—English, Spanish, German, for example—hreflang tags guide search engines to show each version to the appropriate audience.

To use this tool, enter a page URL and click check. The tool examines the hreflang tags in the page's HTML and reports what it finds. It validates whether the language codes are correct, whether alternate versions link back to each other, whether you include a self-reference tag, whether you have x-default coverage for unlisted regions, and whether any duplicate values exist. These checks help identify common configuration errors that prevent search engines from properly routing your language versions.

What hreflang tags do

Hreflang tags are HTML elements that tell search engines about alternate versions of a page in different languages or for different regions. They look like this: <link rel="alternate" hreflang="es" href="https://example.com/es/page" />. Without them, Google may serve the wrong language version to users in your target market, or it may index multiple versions as duplicates instead of treating them as intentional variants.

When you publish the same content in English, Spanish, and German, search engines need to know which version to show to each audience. Hreflang tags provide that instruction. Without them, a German user might see your English page because Google cannot distinguish it from the Spanish one. Or worse, Google may penalize all versions for duplicate content when they are actually translations serving different markets.

Search engines like Google, Bing, and Yandex read hreflang tags in two places: in the HTML <head> as link elements, or in the XML sitemap as xhtml:link elements within each URL entry. Both formats work; many sites use both for redundancy. The tags do not redirect users—they guide search engine crawlers. A user's browser never sees the hreflang attribute; it is metadata for search.

How to check hreflang tags with this tool

This tool validates hreflang implementation on a single page. Enter the full URL you want to check—for example, https://example.com/en/page or https://example.com/es/page. The tool fetches that page, reads the hreflang tags in its HTML head, and reports what it finds.

  1. 1Enter the full URL of the page you want to validate. Include the protocol (https://) and the exact path.
  2. 2Click the check button and wait for results.
  3. 3Review the hreflang tags the tool found on that page. It will list each tag's language code, region code (if present), and target URL.
  4. 4Check for validation issues: missing return links, invalid language codes, duplicate values, or mismatched canonical tags.
  5. 5If you find issues, update the tags in your HTML or sitemap and re-run the check to confirm the fix.

The tool checks one page at a time. If your site has hundreds of pages and multilingual versions, audit a sample across different sections—homepage, main product pages, navigation pages, and deep content—to spot patterns in how your tags are implemented.

Hreflang validation checks explained

A hreflang checker scans for several types of errors. Understanding each one helps you fix problems and prevent them in the future.

Return link reciprocity means if your English page points to the Spanish version via hreflang, the Spanish page should point back to the English version. If the English page says 'go to example.com/es/page for Spanish,' the Spanish page must say 'go to example.com/en/page for English.' If the link is one-way only, search engines may ignore the tags or treat the pages as separate content rather than variants. Reciprocal linking tells Google these pages are intentional alternatives, not competing versions.

The x-default tag tells search engines which page to show users whose language or region does not match any of your hreflang tags. If you serve English, Spanish, and German, the x-default typically points to your English page. This catches users in Italy, France, Japan, and everywhere else you do not explicitly serve. If you publish hreflang tags but omit x-default, Google may not know what to do with users outside your specified locales.

Duplicate hreflang values occur when the same URL appears in multiple tags on the same page, or when two language versions point to the exact same URL. For example, listing hreflang="en" twice, or having both hreflang="en" and hreflang="en-US" point to https://example.com/page. This confuses search engines about which is the primary version.

Self-referencing tags mean a page's hreflang tags should include a tag that points back to itself. The English page should reference itself as hreflang="en", not only reference other languages. Without self-reference, Google may assume the page is not the canonical version of that language and choose a different one.

Canonical tag conflicts happen when a page's hreflang tag points to one URL but its canonical tag points to another. If the English page has hreflang="en" pointing to https://example.com/en/page but the canonical tag points to https://example.com/page, the signals are mixed. Search engines prioritize the canonical tag, which may override your hreflang instruction.

Valid hreflang language and region codes

Hreflang tags require valid ISO language and region codes. Language codes use the ISO 639-1 standard (two-letter codes like 'en', 'es', 'de'). Region codes use ISO 3166-1 (two-letter codes like 'US', 'MX', 'DE'). Together they look like hreflang="en-US" for English in the United States or hreflang="es-MX" for Spanish in Mexico.

You can use language code alone (hreflang="en" for all English-speaking regions) or language plus region (hreflang="en-GB" for English specifically in the United Kingdom). If you serve the same content to multiple countries—say, the US, UK, and Canada all get the same English page—you can list them separately (hreflang="en-US", hreflang="en-GB", hreflang="en-CA") or use just hreflang="en" to cover all English speakers at once.

Language CodeLanguageRegion CodeRegionFull Example
enEnglishUSUnited Stateshreflang="en-US"
esSpanishESSpainhreflang="es-ES"
esSpanishMXMexicohreflang="es-MX"
deGermanDEGermanyhreflang="de-DE"
frFrenchFRFrancehreflang="fr-FR"
frFrenchCACanadahreflang="fr-CA"
ptPortugueseBRBrazilhreflang="pt-BR"
zhChineseCNChinahreflang="zh-CN"
jaJapaneseJPJapanhreflang="ja-JP"
x-defaultDefault/any localehreflang="x-default"

Invalid codes like 'eng' instead of 'en', or 'US' instead of region context, are often caught by hreflang checkers and reported as errors. Many checkers offer smart suggestions—they will flag 'eng' and suggest 'en', or flag 'en-UK' and suggest 'en-GB' (the correct ISO code for the United Kingdom).

Common hreflang mistakes

Hreflang tags are simple in concept but easy to misconfigure at scale. The most common mistakes are:

  • Missing return links: The English page points to Spanish via hreflang, but the Spanish page does not point back to English. Search engines then ignore both tags and treat the pages as separate content competing for the same audience.
  • No x-default tag: All hreflang tags specify language and region, but nothing tells Google what to show users in unlisted countries. They may see a random variant instead of your intended fallback.
  • Pointing hreflang to a redirect: The hreflang tag targets a URL that 301-redirects to another page. Search engines may not follow the redirect in hreflang contexts, leaving the link broken.
  • Mismatched http/https or www variants: One page uses https:// in its hreflang tag, another uses http://. Or one uses www.example.com and another uses example.com. These are treated as different URLs, breaking reciprocity.
  • Using hreflang in the sitemap but not in HTML: If you only list hreflang tags in your XML sitemap and never add them to page HTML, some search engines may not pick them up. Both formats work, but redundancy is safer.
  • Listing the same URL multiple times with different codes: For example, hreflang="en" and hreflang="en-US" both pointing to the same https://example.com/en/page. This tells search engines the page serves multiple purposes, creating confusion.
  • Forgetting the self-reference: A page's hreflang tags mention other languages but do not include a tag for its own language. Without it, Google may not treat the page as the canonical version of that language.

How hreflang errors affect rankings

When hreflang tags are missing or wrong, search engines cannot reliably determine which version of a page to show to which audience. The result is usually one of three problems: wrong-language pages in search results, duplicate content penalties, or missed ranking opportunities in specific locales.

If you publish a Spanish version of a page but do not tell Google about it via hreflang tags, Spanish-speaking users may see your English page in Spanish search results. Google will not know the Spanish version exists. Over time, the English page may rank for Spanish keywords by accident, stealing traffic that should go to the Spanish variant. Neither page ranks well because they are competing with each other instead of complementing each other.

Without correct hreflang tags, Google must guess which version is 'primary' for each language. It might choose your English version as the canonical and treat your Spanish and German pages as mere duplicates. This means those pages get little crawl budget and no independent ranking power—they are invisible in local search results.

Businesses with multiple language versions often see a sharp improvement in regional search visibility after implementing correct hreflang tags. The pages themselves do not change, but search engines now understand what they are for and serve them to the right audiences. An e-commerce site with English, Spanish, and Portuguese versions will suddenly rank for product keywords in Brazil, Mexico, and the US individually, rather than all versions fighting for the same spot.

Running a hreflang check regularly—especially after site migrations, URL structure changes, or translation updates—prevents these silent failures. A small fix to reciprocity or a missing x-default tag can unblock visibility in an entire region.

When to audit your hreflang tags

Check your hreflang implementation whenever your site's language or regional structure changes:

  • After launching a new language version: Verify the English and new language pages link to each other and include x-default.
  • After restructuring URLs: If you rename /en/ to /english/ or change your domain structure, hreflang tags may point to URLs that no longer exist.
  • When adding or removing regional variants: If you stop serving Spanish in Mexico but keep Spanish in Spain, update the hreflang tags to reflect the change.
  • After a site migration: When moving to a new domain or protocol (http to https), hreflang tags must update to point to the new URLs.
  • When deploying automated translation: If you use a translation service or plugin that generates alternate pages, verify it is also generating correct hreflang tags.
  • Before a major SEO audit: A hreflang check is a standard part of technical SEO audits for any site serving multiple languages or regions.

Frequently asked questions

How do I check hreflang tags?+

Enter your page's full URL into this tool. It fetches the page, reads the hreflang tags in its HTML head, and reports what it finds. You can also view hreflang tags manually by right-clicking a page in your browser, selecting 'View page source', and searching for 'hreflang'. For entire sites, check your XML sitemap or use a crawler tool to audit multiple pages at once.

What is an hreflang tag used for?+

Hreflang tags tell search engines which language or region version of a page is intended for which audience. They prevent search engines from indexing duplicate content in different languages and ensure the right version appears in search results for each locale. For example, hreflang="de-DE" points to the German version of a page, so German users see it instead of an English or Spanish version.

Can I use hreflang without language variants?+

Hreflang is designed for language and regional variants, not general duplicate content. If you have the same content on example.com and www.example.com, use a canonical tag instead. Hreflang is specifically for telling Google 'this page is the French version, that one is the Spanish version,' not 'these two URLs are duplicates.'

What happens if I forget the x-default tag?+

Without x-default, search engines do not know which version to show users in regions you do not explicitly serve. A user in Italy might see your German page even though you intended the English version as the fallback. The x-default tag acts as a catch-all for everyone outside your specified language and region combinations.

Do hreflang tags affect click-through rate or user experience?+

No. Hreflang tags are metadata for search engines only. Users never see them. They do not redirect browsers or change the page users see. They only guide search engines on which version to recommend in search results.

How many hreflang tags can one page have?+

A page can have as many hreflang tags as needed—one for each language or regional variant you publish, plus x-default. A global e-commerce site might have 20 or more hreflang tags on a single product page (one for each country served). More tags are fine; what matters is that they are correct and reciprocal.

Related free tools

On-page SEO scorerOn-page meta checkerWebsite speed testMobile-friendly test

On this page

  • Overview
  • What hreflang tags do
  • How to check hreflang tags with this tool
  • Hreflang validation checks explained
  • Valid hreflang language and region codes
  • Common hreflang mistakes
  • How hreflang errors affect rankings
  • When to audit your hreflang tags