Skip to content
SEO Madmanby Adam Hafez
Free tool

Hreflang tag generator and validator

Build correct <link rel="alternate" hreflang> tags for a set of localized URLs and check them against Google's reciprocity and x-default rules.

Runs entirely in your browser. Nothing you enter is uploaded, logged or stored.

    Key takeaways

    • Google ignores hreflang annotations for a URL if that URL does not also point back to itself and to every other language version in the set.
    • The x-default value is optional and works as a fallback for visitors whose language does not match any of the listed versions.
    • A language and region code such as en-US may only point at one URL; pointing the same code at two URLs makes the pair ambiguous.
    • Codes must use a lowercase ISO 639-1 language, with an optional uppercase ISO 3166-1 Alpha-2 region after a hyphen.

    What it takes

    • A URL for each localized version of a page
    • The language code for each URL, with an optional region
    • An optional x-default row for the language selector or fallback page

    More tools

    All of them free, all of them browser-only.

    Browse the tools

    How to use it

    1. 1Add a row for every localized URLUse the exact URL Google would index for that language, including the protocol and any trailing slash you actually publish.
    2. 2Set the language code for each rowUse a lowercase ISO 639-1 code such as en or es, and add a region after a hyphen only when the content genuinely differs by region, such as en-US versus en-GB.
    3. 3Add every URL as a row on itself tooReciprocity means each URL needs a row pointing at its own language, not only rows pointing at the other versions.
    4. 4Add x-default if you have a language selector or fallbackThis is optional, but Google recommends it so visitors whose browser language matches nothing in the set land somewhere useful.
    5. 5Read the warningsThe tool flags missing self-references, duplicate codes pointing at different URLs, and invalid code formats before you ship the tags.
    6. 6Copy and pastePaste the generated link tags into the head of every page in the set, not just one of them.

    Hreflang tags tell Google which URL to show for a given language and region, and which other URLs are alternate versions of the same page. Getting the tag syntax right is the easy part; the rules that make Google actually trust the set are what most hreflang implementations get wrong.

    Why reciprocity matters

    Google’s own documentation states that if two pages do not both point to each other, the annotations are ignored. This means hreflang is not a one-way hint you drop on your primary page. Every URL in the set needs a link tag pointing at itself and at every other URL, including the version currently being crawled. A common failure mode is a site that lists all its translations on the English homepage but never adds the reciprocal tags on the translated pages themselves; Google treats that set as unreliable and may ignore it entirely for the URLs that fail to reference themselves.

    What x-default does, and does not, guarantee

    The x-default value marks a fallback page for visitors whose language and region do not match any of the listed versions, commonly a language selector or a default locale. Google documents it as optional and recommended, not required. Adding it does not change how the other language versions rank against each other; it only affects what a visitor with an unmatched language setting sees. Sites with only two or three language versions can often skip it without penalty, but any set built for a broad international audience benefits from having one.

    Usage note

    This tool runs entirely in the browser: no URL or code you enter is sent anywhere. Because it has no way to crawl the other pages in a set, its reciprocity check is limited to what the entered data can prove, that each URL has a row pointing back at its own language. It cannot confirm that the live page at that URL actually carries the matching tags, so treat a clean result here as a starting point, then verify the live pages with Search Console’s International Targeting report.

    Sources

    1. 1.Tell Google about localized versions of your page - Google Search CentralPrimary
    Tools

    Hreflang XML sitemap generator

    Build a sitemap with xhtml:link hreflang annotations for localized pages, with every alternate listed on every URL as Google's documentation requires.