web validator

Canonical & hreflang Validator

Validate canonical URLs, hreflang alternates, x-default fallbacks, absolute target URLs, and duplicate-content signals before search engines cluster or localize pages incorrectly.

Results

Paste input and validate locally.
Status
Ready when you validate.
Details
Ready when you validate.
Missing/invalid
Ready when you validate.
Invalid URLs
Ready when you validate.
Duplicate hreflang
Ready when you validate.

How to use this validator

  1. Open the final rendered page source or deployed preview for the page you want search engines to index.
  2. Copy the <head> block or just the canonical and hreflang link tags into the validator.
  3. Run the check and fix any missing canonical, relative URL, invalid hreflang code, or duplicate hreflang entry it reports.
  4. For multilingual pages, repeat the check on each language URL and confirm reciprocal alternates, 200-status targets, and redirects in your crawler or SEO QA workflow.

Rules & checks

Requires one canonical link tag with an absolute http/https URL that represents the preferred indexable version.

Checks hreflang alternates for language or language-region codes such as en, en-us, es, fr-ca, or x-default.

Flags missing canonical tags, relative canonical URLs, invalid alternate hrefs, duplicate hreflang codes, and staging/preview target mistakes that can leak into launch HTML.

Keeps x-default, self-referential canonical, and localized alternate relationships visible for international SEO QA.

Runs locally on pasted HTML; it does not crawl alternate pages, verify reciprocal hreflang backlinks, or prove Google-selected canonical state.

Inputs explained

  • Rendered HTML or <head> snippet

    Paste the rendered HTML head from view-source, a framework preview, or a CMS template export. Include canonical and alternate hreflang link tags when possible.

When to use it

  • QA multilingual product, docs, or marketing pages before a locale launch
  • Check staging and Vercel preview HTML before it ships to the canonical domain
  • Review CMS, ecommerce, static-site, or Next.js templates that generate canonical and alternate link tags
  • Confirm a duplicate-content cleanup added the intended canonical URL to filtered, parameterized, syndicated, or faceted pages
  • Compare sitemap.xml entries, robots.txt access, meta robots indexability, and canonical targets during an SEO release pass
  • Debug Search Console canonicalization notes such as Duplicate without user-selected canonical or Google chose different canonical than user

Common errors

  • Missing canonical link on pages that should consolidate ranking signals
  • Relative canonical URLs such as /pricing instead of https://example.com/pricing
  • Canonical tags pointing at noindex, redirected, blocked, or non-200 target URLs
  • Duplicate hreflang codes pointing to different URLs
  • Invalid or inconsistent language-region casing like en_US instead of en-us
  • Staging, preview, or localhost URLs left in canonical or alternate href values
  • Omitting x-default for international landing-page sets where a fallback URL is useful
  • Publishing sitemap.xml URLs that disagree with the canonical href rendered on the page

Limitations

  • Does not fetch URLs, crawl alternate pages, or verify that canonical/hreflang targets return HTTP 200.
  • Does not prove Google selected the canonical; it checks the link tags present in pasted HTML.
  • Does not validate reciprocal hreflang backlinks across every localized URL.
  • Does not evaluate whether translated page content is equivalent or whether a page should be indexed.

Tips

  • Validate rendered HTML, not only source components, because frameworks and CMS plugins can rewrite link tags at build or runtime.
  • Keep canonical URLs self-referential unless you intentionally consolidate duplicates into a primary page.
  • Make sitemap.xml, internal links, Open Graph URLs, and canonical hrefs agree on the same preferred URL when possible.
  • Use lowercase language codes and hyphenated regions, such as en-gb or fr-ca, to avoid messy QA diffs.
  • If a page has hreflang alternates, check the reciprocal set with a crawler too; this tool only inspects the pasted page.

Examples

Valid multilingual launch set

  • <link rel="canonical" href="https://example.com/en/pricing" />
  • <link rel="alternate" hreflang="en" href="https://example.com/en/pricing" />
  • <link rel="alternate" hreflang="es" href="https://example.com/es/precios" />
  • <link rel="alternate" hreflang="x-default" href="https://example.com/pricing" /> -> Valid tags

Invalid: relative canonical

  • <link rel="canonical" href="/pricing" /> -> Invalid because canonical href values must be absolute URLs

Invalid: duplicate hreflang

  • <link rel="alternate" hreflang="en" href="https://example.com/en/" /> + another hreflang="en" entry -> flagged duplicate

Deep dive

Canonical and hreflang tags sit in the same launch-QA layer as robots.txt, sitemap.xml, meta robots, title tags, Open Graph, and JSON-LD: they are small snippets that can change how search engines cluster, index, and serve a page.

Use this validator to catch absolute-URL mistakes, duplicate hreflang values, bad language codes, staging hosts, missing x-default alternates, and sitemap/canonical mismatches before a crawler turns the issue into duplicate-content or international SEO cleanup work.

Because the check runs in your browser on pasted HTML, you can review unreleased pages, private staging output, client locale templates, or CMS exports without sending source code or page markup to a server.

FAQs

Should every page have a canonical tag?
Most indexable pages should declare a canonical URL, usually self-referential. Duplicate or parameterized pages can intentionally canonicalize to a cleaner primary URL.
What does x-default mean in hreflang?
x-default points search engines to a fallback URL when no language or region-specific alternate is the best match, such as a global selector or default landing page.
Do you fetch each hreflang URL?
No. This is a structural check on pasted HTML. Use a crawler or CI smoke test to verify HTTP status, reciprocal tags, and redirects.
Can I paste a full HTML document?
Yes. Paste a full rendered HTML document or just the relevant <head> link tags; validation stays local in your browser.
Does this decide which canonical Google will choose?
No. Google may choose a different canonical based on redirects, internal links, sitemap signals, robots/indexability signals, and duplicate content. This tool confirms the HTML signal you are sending.
How should this line up with sitemap.xml and meta robots?
For pages you want indexed, sitemap.xml should list the preferred URL, meta robots should allow indexing, and the rendered canonical should point at the same preferred target or an intentional consolidation target.

Related validators

All canonical and hreflang validation runs in your browser. Pasted HTML is not uploaded, logged, or stored.

Structural link-tag check only; does not crawl URLs, verify reciprocal hreflang, or assess indexation status.