Hreflang Tag Checker
Paste the hreflang link tags from a page's <head> — or paste the whole head and the tool will pick them out. Add the page's own URL as well and it will also check the self-reference, which is the part most hreflang sets get wrong.
Paste it exactly as it appears in the page's canonical tag, trailing slash and all. Leave it empty and every check still runs except the self-reference one.
Link tags, a whole <head>, or one code url pair per line pasted from a spreadsheet — all three are read.
| Result | hreflang | href | What was found |
|---|
One row per tag, in the order they appear in what you pasted. A row marked as a problem is explained in the list above the table.
Codes are lowercased, underscores become hyphens, exact duplicates are dropped and x-default is moved to the end. Tags with an invalid code or a non-absolute URL are left out rather than guessed at — fix those by hand, because changing a code changes who the page is served to.
What Is an Hreflang Tag Checker?
An hreflang tag checker reads the set of <link rel="alternate" hreflang="…"> tags on a page and tells you whether search engines can actually use them. Hreflang is the markup that links the different language and country versions of the same page together, so that a searcher in Mexico gets the Spanish page and a searcher in Berlin gets the German one. It is also the most fragile piece of markup in technical SEO: the syntax is strict, the error messages are nonexistent, and a set of tags with one bad code in it fails quietly. Nothing breaks, nothing 404s, and Google simply ignores the annotation and goes back to guessing which version to show.
That silence is the problem this tool solves. It parses every tag you paste, validates the language code against ISO 639-1 and the region code against ISO 3166-1 Alpha 2, and then looks at the set as a whole for the faults that only show up when the tags are read together — the same code declared twice with different URLs, a missing x-default, a self-reference that is one trailing slash away from matching. Everything happens in your browser, so you can check a staging site, a client's page or a block of tags that is not published yet.
What This Checker Looks For
Each tag is checked on its own first, then the whole set is checked together. These are the faults it reports.
- Invalid language codes. The first part of an hreflang value has to be a real ISO 639-1 language code. cn, jp, gr and dk are country codes that look like languages and are not — the languages are zh, ja, el and da. Where there is an obvious intended code, the tool names it.
- Invalid or reversed region codes. The second part has to be an ISO 3166-1 Alpha 2 country code, and it comes after the language, never before. gb-en is reported as the wrong way round, and en-en as a language where a country belongs.
- The en-uk mistake. Far and away the most common invalid hreflang value in the wild. The ISO country code for the United Kingdom is gb, so the correct value is en-gb. uk on its own is a valid code, but it means Ukrainian.
- Codes that are valid but probably not what you meant. eu is Basque, not Europe. ca is Catalan, not Canada. br is Breton, not Brazil. se is Northern Sami, not Sweden. These pass as language codes, so no validator can call them errors — they are flagged as worth a second look.
- Underscores instead of hyphens. en_US is the format programming languages use for locales and it is invalid in hreflang, which wants en-US. It is the classic symptom of hreflang generated from an application's locale list.
- Relative and protocol-relative URLs. Hreflang needs a full absolute URL. /es/ and //example.com/es/ are both ignored by search engines.
- Duplicate and conflicting codes. The same code twice with the same URL is clutter. The same code twice with different URLs is a conflict, and a conflicting annotation is discarded rather than resolved.
- A missing self-reference. Give the tool the page's own URL and it checks that the set includes a tag pointing back at it, and tells you when the only candidate differs by a trailing slash, a protocol or a www.
- A missing x-default. Not an error, but the tag that decides where everyone you have not targeted lands.
- Mixed protocols and inconsistent trailing slashes across the set, which are usually the fingerprint of a list assembled by hand over time.
How to Use the Hreflang Tag Checker
- Open one of your language versions, view source, and copy the <link rel="alternate" hreflang="…"> tags out of the <head>. Copying the whole head is fine — anything that is not an hreflang tag is ignored.
- Paste that page's own URL into the first box, exactly as the page's canonical tag writes it.
- Click Check tags. Problems are listed worst first, and the table underneath shows every tag with what was found on it.
- Fix the tags on the page, or copy the cleaned-up block if the only faults were formatting ones.
- Repeat for each language version. Hreflang is only confirmed when every version carries the full set, so one page passing is not the same as the group passing.
If you want to see what a failing set looks like before you paste your own, the Load a sample button fills both boxes with a deliberately broken set that contains most of the common faults at once.
Why the Self-Reference Matters So Much
Hreflang is the one piece of markup that has to agree with itself across several pages. Google only trusts an annotation when it is confirmed from both ends: if your English page says the Spanish page is its Spanish version, the Spanish page has to say the English page is its English version. These are return tags, and an unconfirmed one is ignored. The practical way to get this right is for every page in the group to carry the identical block listing all versions, itself included — which is exactly why a missing self-reference is such a reliable sign that the whole cluster is broken.
The subtler failure is the self-reference that almost matches. Hreflang URLs are compared as strings, so https://example.com/uk and https://example.com/uk/ are two different pages as far as the annotation is concerned, and so are the http and https versions, and the www and non-www ones. A set where every URL is written one way and the pages are served another way looks completely correct in view-source and does nothing at all. That is the check the page URL box exists for: when the tool finds a near miss rather than a match, it says so and shows you both strings.
Every URL in the set should also be a live page that returns 200, not a redirect and not a 404. Hreflang pointing at a redirect is a weak signal at best and ignored at worst, and the fix is always to point the tag at the destination instead. Trace anything you are unsure about with the Redirect Checker, then come back and correct the href.
Hreflang, Canonical and Noindex Have to Agree
Three signals decide which version of a page gets indexed and shown, and hreflang is only one of them. The other two cancel it out when they disagree.
The first is the canonical tag. Each language version must canonicalise to itself. Pointing the Spanish page's canonical at the English page says "this is a duplicate, index the English one instead", which contradicts the hreflang saying "this is the Spanish version, show it to Spanish speakers". Google resolves that contradiction by dropping the hreflang. Confirm each version points at itself with the Canonical URL Checker, and remember that the URL in the canonical tag is also the string your hreflang hrefs should match character for character.
The second is the robots meta tag. A page carrying noindex cannot be returned in search results, so naming it as a language alternative achieves nothing — and because the annotation is then unconfirmed from that side, it can weaken the rest of the cluster too. This catches people out on staging subdomains and on country pages that were quietly noindexed months earlier. Check what each version actually declares with the Meta Robots Tag Checker.
If you are auditing more than a handful of pages, pull the head markup for all of them at once with the Bulk Meta Tags Extractor and bring each page's tags back here one set at a time. When the tags turn out to be wrong rather than merely untidy, rebuild the block from scratch with the Hreflang Tag Generator, which only lets you pick valid ISO codes and writes the whole group in one go, then paste the result back in here to confirm it.
Where Hreflang Can Live, and Why That Matters Here
Hreflang can be declared in three places: in the HTML head, in an HTTP Link: response header, or as xhtml:link entries inside an XML sitemap. One of the three is enough, and declaring the same page in two of them is how sites end up with sets that contradict each other. This tool checks the head markup, because that is where the overwhelming majority of sites put it and the only one you can copy out of view-source. If your annotations are in the sitemap instead, the same rules apply to them — every URL absolute, every version listed on every URL, codes valid, x-default present — and the XML Sitemap Generator is a reasonable place to start if you need to rebuild that file around a clean list of URLs. If they are in an HTTP header, you will need to read the response headers directly; nothing in the page source will show them.
What This Tool Cannot Check
It reads what you paste and nothing else. That is deliberate — it is what makes it safe for unpublished pages and client work — and it draws a hard line around what the result means.
It cannot confirm return tags, because confirming them means reading the other pages in the group. Running one set through here and getting a clean result tells you that page's tags are internally valid, not that the cluster is confirmed; for that, check each version in turn and make sure all of them list the same URLs. It cannot tell you whether a URL responds, redirects or carries a noindex, which is why the three tools above exist. It cannot tell you whether the page at the other end is genuinely in the language you claimed, and an hreflang set pointing at machine-translated pages that nobody has read is valid markup and a bad idea. And it cannot tell you whether you need hreflang at all: a site in one language aimed at one country does not, and adding it there creates work and risk for no benefit.
What it does do is catch the faults that account for most broken hreflang in practice — a bad code, an underscore, a relative URL, a duplicated value, a self-reference that does not quite match — in the time it takes to paste a block of tags. Those are precisely the faults that are invisible in a browser and that no amount of looking at the page will reveal.
Frequently Asked Questions
Yes. The region part of an hreflang value comes from ISO 3166-1 Alpha 2, and in that standard the United Kingdom is GB. UK is reserved but not assigned, so en-uk is an invalid value and the tag is ignored. Confusingly, uk on its own is perfectly valid as a language code — it means Ukrainian. If you want English for the United Kingdom, the only correct value is en-gb.
No, because it never leaves your browser and so cannot read your other pages. It checks one page's set at a time: the codes, the URLs, the duplicates, and whether the set points back at the page you say it is on. To confirm the whole cluster, check each version in turn and compare the lists — every page in the group should declare the same URLs, including its own. A page whose set is missing one version is the single most common reason a whole hreflang cluster is ignored.
It is optional, and the tool reports a missing one as a warning rather than an error. It is still worth adding. x-default names the page for everyone your other tags do not cover — the visitor whose language you do not publish in. Without it, search engines pick one of your versions for those people, usually the one that happens to rank. A language picker, an international home page or your main-language version are all reasonable targets, and it is normal for the x-default URL to be the same as one of your other versions.
Yes, and sometimes you should. x-default sharing a URL with another version is standard practice. A single English page serving both en and en-ie is legitimate too. What is not allowed is the reverse: the same hreflang value appearing twice with two different URLs. That is a conflict, and a conflicting annotation is thrown away rather than resolved, so the tool reports it as an error.
Hreflang values are not case sensitive, so en-GB, en-gb and EN-GB all work. The cleaned-up block lowercases them because a consistent set is easier to compare across pages by eye, which is most of the work in an hreflang audit. The one thing case cannot rescue is an underscore: en_GB is invalid whatever the capitalisation.
No. The parsing, the validation and the copy button all run in JavaScript in your browser, and no request of any kind is made. Closing the tab discards everything, so an unlaunched market, a staging domain or a client's URL structure is safe here. It is also the reason the tool cannot fetch your other language versions to confirm return tags for you — it only ever sees the text in the boxes.