Staaarter

Hreflang Tag Checker

Fetches a page (or accepts pasted HTML) and validates its <link rel="alternate" hreflang="..."> tags: flags duplicate hreflang values, checks each value looks like a valid language or language-region code, notes whether an x-default entry is present, and checks whether the page's own URL is self-referenced in the set. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-04
By Staaarter Team
checkerliveinternational

Overview

Introduction

Hreflang tags tell search engines which URL to show searchers for a given language or region, letting a multilingual site avoid duplicate-content issues while still surfacing the right localized version to the right audience - but the syntax is notoriously easy to get subtly wrong, and errors here are almost invisible without a dedicated checker.

This tool fetches a page (or reads pasted HTML) and checks its hreflang alternate-link tags for the mistakes that most commonly break international targeting: duplicate values, malformed language codes, and a missing self-reference.

What Is Hreflang Tag Checker?

An hreflang tag auditor that extracts every <link rel="alternate" hreflang="..."> tag from a page and validates each value's format, checks for duplicates, and notes whether an x-default entry and a self-referencing entry are present.

It works two ways: fetching a URL directly when the target allows cross-origin requests, or reading HTML you paste in, which works regardless of CORS.

How Hreflang Tag Checker Works

The HTML is parsed with the browser's DOMParser and every hreflang alternate-link tag is collected, then each value is checked against a pattern for valid language/language-region codes (or the literal x-default).

Values that appear more than once are flagged as duplicates, since search engines treat a repeated or conflicting hreflang value as an unreliable signal; presence of x-default and, when a URL was fetched, a self-referencing entry are reported as informational notes rather than errors.

When To Use Hreflang Tag Checker

Auditing a multilingual site's hreflang implementation after adding a new language or region variant.

Debugging why Google Search Console is reporting hreflang errors for a set of localized pages, by checking for duplicate or malformed values first.

Often used alongside Canonical URL Checker and Meta Tag Checker.

Features

Advantages

  • Validates the language-code format itself, catching malformed codes like reversed order or wrong separators that are easy to type incorrectly.
  • Distinguishes hard errors (duplicates, invalid codes) from informational notes (missing x-default, missing self-reference) rather than treating everything as a failure.
  • Works on any page via the paste-source fallback, not just pages with permissive CORS.

Limitations

  • This tool only checks the tags on the single page you fetch or paste; a complete hreflang audit also requires confirming return tags exist on every referenced alternate URL, which this tool doesn't crawl to verify.
  • A live fetch only works when the target sends permissive CORS headers, which most ordinary websites don't; use the paste fallback for anything else.

Examples

A well-formed hreflang set

Input

<link rel="alternate" hreflang="en" href="https://example.com/">
<link rel="alternate" hreflang="es" href="https://example.com/es/">
<link rel="alternate" hreflang="x-default" href="https://example.com/">

Output

en: good
es: good
x-default: present

Both language codes are valid and unique, and an x-default entry is included.

A page with a duplicate and a malformed code

Input

<link rel="alternate" hreflang="en" href="https://example.com/">
<link rel="alternate" hreflang="en" href="https://example.com/en-alt/">
<link rel="alternate" hreflang="US-en" href="https://example.com/us/">

Output

en: warning (appears 2 times)
US-en: warning (invalid format, expected en-US order)

"en" is duplicated with two different hrefs, and "US-en" has the language and region reversed.

Best Practices & Notes

Best Practices

  • Always write language-region codes with the language first and region second, separated by a hyphen (en-US, not US-en or en_US).
  • Include a self-referencing hreflang entry on every localized page, pointing to that page's own URL, in addition to entries for all its sibling language versions.

Developer Notes

The self-reference check only runs when the tool fetched a live URL (via FetchOrPasteInput's onFetched callback), since pasted-only HTML gives no reliable way to know what URL it represents; it's silently skipped, not flagged as an error, when only pasted HTML is available.

Hreflang Tag Checker Use Cases

  • Validating hreflang tags on a new localized page before it goes live
  • Investigating Google Search Console hreflang error reports by checking the flagged page's raw tag values
  • Confirming an x-default entry exists on a language-selector or root domain page

Common Mistakes

  • Reversing the language and region order (US-en instead of en-US), which most crawlers simply treat as invalid and ignore.
  • Forgetting to add a self-referencing hreflang entry on each localized page, which Google's guidelines call out as a common implementation error.

Tips

  • Keep hreflang values lowercase for the language part and uppercase for the region part (en-US, not en-us or EN-US) to match the convention most examples and validators expect, even though matching is technically case-insensitive.

References

Frequently Asked Questions