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
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.