Paste or type your HTML content containing hreflang tags to validate
Hreflang Validator
How It Works
- Step 1: Paste hreflang link tags from HTML head section including rel="alternate", hreflang attribute with language-region codes (en-US, fr-FR), and href URLs for alternate versions.
- Step 2: The validator parses hreflang tags checking ISO 639-1 language codes (en, fr, de), ISO 3166-1 Alpha 2 country codes (US, GB, DE), and x-default tag for fallback pages.
- Step 3: Validates bidirectional linking (return tags) ensuring each alternate page links back to the original, checks for self-referencing tags, and verifies URL consistency (protocol, domain).
- Step 4: Provides validation report with errors (invalid language codes, missing return links), warnings (duplicate hreflang values), and recommendations for international SEO implementation.
Manual vs Automated Hreflang Validation
| Feature | Manual Checking | AI-Powered Validator |
|---|---|---|
| Language Code Validation | Look up ISO 639-1 codes manually | Instant validation against ISO standards |
| Return Link Checking | Manually verify bidirectional links | Auto-checks return tags on all pages |
| Duplicate Detection | Manually scan for duplicates | Instant duplicate hreflang detection |
| x-default Validation | Manually verify fallback page | Validates x-default tag presence |
| URL Consistency | Check protocol/domain manually | Auto-validates URL format consistency |
| SEO Recommendations | No automated guidance | Provides international SEO best practices |
Hreflang Validation Examples
Example: Hreflang Tag Validation
<!-- English US version -->
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
<!-- Invalid tags -->
<link rel="alternate" hreflang="english" href="https://example.com/en/" />
<link rel="alternate" hreflang="en-US" href="http://example.com/en-us/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" /> Validation Report:
✅ VALID TAGS (5):
Tag 1: hreflang="en-US"
✓ Valid language code: en (English)
✓ Valid country code: US (United States)
✓ URL: https://example.com/en-us/
✓ Protocol: HTTPS (secure)
Tag 2: hreflang="en-GB"
✓ Valid language code: en (English)
✓ Valid country code: GB (United Kingdom)
✓ URL: https://example.com/en-gb/
Tag 3: hreflang="fr-FR"
✓ Valid language code: fr (French)
✓ Valid country code: FR (France)
✓ URL: https://example.com/fr-fr/
Tag 4: hreflang="de"
✓ Valid language-only code: de (German)
✓ No country targeting (all German speakers)
Tag 5: hreflang="x-default"
✓ Valid default fallback tag
✓ URL: https://example.com/
ℹ️ Purpose: Fallback for unmatched languages
❌ ERRORS (3):
Tag 6: Invalid language code
<link rel="alternate" hreflang="english" href="..." />
Error: 'english' is not a valid ISO 639-1 code
Fix: Use 'en' for English
Valid codes: en, fr, de, es, it, pt, ja, zh, etc.
Tag 7: Protocol mismatch
<link rel="alternate" hreflang="en-US" href="http://example.com/en-us/" />
Error: HTTP protocol doesn't match HTTPS on other tags
Fix: Use consistent protocol: https://example.com/en-us/
Impact: Search engines may ignore inconsistent URLs
Tag 8: Duplicate hreflang value
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
Error: Duplicate hreflang="en-US" detected
Fix: Remove duplicate tag (already defined in Tag 1)
⚠️ WARNINGS (2):
Missing self-referencing tag:
Current page should include hreflang tag pointing to itself
Recommendation: Add <link rel="alternate" hreflang="en-US" href="[current-page]" />
Missing return links verification:
Cannot verify if alternate pages link back to this page
Recommendation: Ensure bidirectional linking on all pages
Example: fr-FR page must include hreflang="en-US" tag
✅ CORRECT IMPLEMENTATION:
<!-- On https://example.com/en-us/ page -->
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="fr-FR" href="https://example.com/fr-fr/" />
<link rel="alternate" hreflang="de" href="https://example.com/de/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Summary:
Valid Tags: 5
Invalid Tags: 3
Duplicate Tags: 1
Languages Configured: 4 (en-US, en-GB, fr-FR, de)
Default Fallback: ✓ Present (x-default)
Protocol Consistency: ⚠️ Mixed HTTP/HTTPS Key Changes:
The validator enforces Google's hreflang implementation guidelines, catching errors that cause search engines to ignore international targeting. Invalid language codes like 'english' instead of 'en' violate ISO 639-1 standard—only two-letter codes are valid. Protocol mismatches (HTTP vs HTTPS) cause Google to ignore hreflang tags because URLs must be consistent across all tags. Duplicate hreflang values create ambiguity—Google can't determine which URL to serve for en-US users. Missing self-referencing tags are a common error—each page must include a hreflang tag pointing to itself for proper implementation. The x-default tag is critical for international sites—it specifies the fallback page for users whose language/region doesn't match any hreflang tag. Bidirectional linking is required—if page A links to page B with hreflang, page B must link back to page A. Without return links, Google may ignore the entire hreflang implementation. Language-only codes (de) target all speakers of that language, while language-region codes (de-DE, de-AT) target specific countries. International SEO teams use hreflang validators to prevent duplicate content issues, ensure correct regional targeting, and avoid serving wrong language versions to users—critical for e-commerce sites and global brands.
Frequently Asked Questions
What are hreflang tags?
Hreflang tags are HTML attributes used to indicate the language and geographic targeting of web pages. They help search engines serve the correct language or regional version of a page to users. Hreflang tags are essential for international SEO and multilingual websites.
How does the hreflang validator work?
Our hreflang validator parses HTML content to find hreflang tags, validates their syntax, checks for proper language codes, verifies bidirectional links, and ensures correct hreflang implementation. It provides detailed feedback on any issues found in your hreflang setup.
Is my HTML content safe when using this validator?
Yes, completely safe. All validation happens entirely in your browser using client-side JavaScript. Your HTML content never leaves your device, is never sent to any server, and is never stored or logged anywhere.
What hreflang formats does the validator support?
The validator supports hreflang tags in HTML link elements, HTTP headers, and XML sitemaps. It validates language codes (ISO 639-1), region codes (ISO 3166-1), and proper hreflang syntax according to Google's guidelines.
What common errors does the validator detect?
The validator detects missing hreflang attributes, invalid language codes, missing self-referencing tags, unidirectional links (missing return links), incorrect hreflang syntax, and non-compliance with hreflang best practices.
Can the validator check bidirectional links?
Yes, the validator checks for bidirectional links (reciprocal hreflang tags). It verifies that if page A links to page B with hreflang, page B should also link back to page A. This is a critical requirement for proper hreflang implementation.