Skip to content

Hreflang checker. Locale matrix.

Paste your page HTML. The right panel extracts every <link rel="alternate" hreflang="..."> tag, validates each language + region code against ISO 639-1 and ISO 3166-1, checks for the required x-default, and lists the locale matrix.

Paste the full <head> contents or the entire HTML, only <link rel="alternate" hreflang> tags are parsed.

locale matrix · live

              
    Sources used by this checker

    Privacy: HTML parsed in-browser only.

    § · written guide

    How to use the Hreflang Checker

    The Hreflang Checker reads the hreflang link tags in a page's HTML and lists every language version they point to. It runs six checks on the set: tags found, x-default present, valid language and region codes, no duplicates, no empty links and no en-UK typo. It is for SEO and developers who run a site in more than one language or country and want to catch tag mistakes before Google does.

    Step by step

    1. Copy the page's HTML

      Open the page in your browser, view its source or copy the head from DevTools, and copy it. You can paste the whole page or only the head, because only link tags with rel="alternate" and an hreflang attribute are read.

    2. Paste it into the box

      Replace the sample in Paste page HTML with your code. The box starts with four example tags (en-US, en-GB, en-IN and x-default) so you can see a passing result first. The check runs on every keystroke.

    3. Read the summary line

      At the top of the locale matrix panel, a line counts the checks that passed, warned and failed. Green means everything passed, amber means only warnings, and red means at least one failure.

    4. Check the locale list

      Under the summary, each tag appears as its hreflang code, an arrow and the URL it points to. Codes are shown in lower case. Make sure every language and country you serve is there and points to the right address.

    5. Fix the failed checks

      Below the list, each check has a tick, a warning sign or a cross, with a short note such as how many codes are invalid or which code is duplicated. Fix the page, paste the new HTML and confirm the line turns green.

    Reading the result

    • With the sample tags the summary reads All 6 checks pass, and the list below shows hreflang count 4, x-default present, All locale codes ISO-valid, No duplicate locale tags, All href values present and No en-UK typo, each with a tick.
    • If no tags are found you get a single failed check, rel=alternate hreflang declarations: None found. Check that you pasted the head and that the tags use rel="alternate".
    • x-default present is only a warning when missing, because it is optional, but it tells search engines which URL to show people whose language you do not target.
    • All locale codes ISO-valid checks that the language part is a two letter ISO 639-1 code and that any region part is exactly two letters. en-USA fails because USA has three letters.
    • No en-UK typo is its own check because UK passes the two letter test but is not a country code. Use en-GB for the United Kingdom.

    Tips and common mistakes

    • The checker sees one page at a time, so it cannot confirm reciprocity. Paste the HTML of each language version and check that every page lists the same full set, itself included.
    • The region check only tests for two letters, it does not look the country up. A made up region such as en-XX passes here, so read the list as well as the ticks.
    • Codes with a script or numeric part, such as zh-Hant or es-419, are counted as invalid by this check even though hreflang allows them. If you use them on purpose, you can ignore that failure.
    • Duplicates are found without regard to case, so en-US and en-us count as the same tag.
    • The checker does not test whether the URLs load. Open a few of them, or run them through a status checker, to catch broken or redirected links.

    Privacy and limits

    The HTML is parsed by your own browser and is not sent or saved anywhere. Reloading the page brings the sample tags back.

    Back to the tool

    § 02 · questions

    Six questions users ask.

    What's the format for hreflang?

    ISO 639-1 language code optionally followed by ISO 3166-1 Alpha-2 region. Examples: en, en-US, es-MX, fr-CA. The reserved x-default points at the fallback. Wrong: en-USA (alpha-3 not allowed), en-UK (UK isn't valid, use GB).

    Do I need x-default?

    Strongly recommended. x-default tells Google which URL to serve when no locale matches the user's locale. Without it, Google picks one of the locale-tagged URLs essentially at random.

    What's reciprocity?

    Every locale in your hreflang set must list every other locale, including itself. Missing reciprocity is the #1 hreflang bug, the locale that's missing the back-link gets demoted in Google's eligibility evaluation.

    Should hreflang go in HTML or HTTP headers?

    HTML link tags are easiest. HTTP Link headers work for PDFs. XML sitemap annotations are better for hundreds of locales. Pick one method and stick with it.

    Is en-UK valid?

    No. UK is not a valid ISO 3166-1 country code, use GB (United Kingdom of Great Britain and Northern Ireland).

    Does this tool log my HTML?

    No. The form runs entirely in JavaScript on your device. Nothing is sent to Digital Heroes servers.

    Published · Last updated .

    Priya sent you a message Online now

    Talk to a Developer Now

    Share your name and email to reply.

    Reply