Canonical Tag Generator

Create perfect rel="canonical" tags, validate canonical URLs, detect common duplicate-content…

GENERATOR + VALIDATOR BULK MODE DUPLICATE DETECTION 100% FREE
Free Professional Tool | No Registration Required | Updated: January 2026

Perfect Canonical Tags, Every Time

Fix duplicate content, consolidate ranking signals and boost your SEO with properly configured canonical tags.

Generator Validator Bulk Mode

Generate Canonical Tag

This is the "master" URL you want search engines to index.

URL Normalization Options

Advanced Options

Generated Tag

Your canonical tag will appear here after you click Generate.

Where to Place It

Add the tag inside the <head> section of your page, anywhere before </head>. Only one canonical tag per page is allowed.

Bulk Canonical Generator

Enter one URL per line. Each line becomes a canonical tag on the corresponding page.

Bulk Output

0 tags
Generated canonical tags will appear here.

Validate Canonical Tags

Paste an HTML document to audit its canonical tag. The validator checks for common mistakes including multiple canonicals, relative URLs, cross-domain canonicalization and self-reference issues.

Validation Report

Paste HTML and click Validate Canonical to see the full report.

Complete Canonical Tag Guide

What Is a Canonical Tag?

A canonical tag is an HTML element placed in the <head> of a page that tells search engines which URL is the preferred version to index when multiple URLs contain the same or very similar content. It is written as <link rel="canonical" href="https://example.com/page/">.

Without canonical tags, search engines have to guess which version to rank — and they often guess wrong, splitting your ranking signals across duplicates.

When You Need a Canonical Tag

  • Parameter URLs: ?sort=price, ?color=red, ?ref=newsletter
  • WWW vs non-WWW: example.com vs www.example.com
  • HTTP vs HTTPS: older protocol variants still linked from elsewhere
  • Trailing slash variants: /page vs /page/
  • Pagination: page 2, 3, 4 of a listing
  • Printer-friendly pages: /print/article vs /article
  • Syndicated content: content republished from another site
  • E-commerce filters: same product under different category paths

Canonical Tag Rules You Must Follow

  1. One per page. Multiple canonicals confuse crawlers and can be ignored entirely.
  2. Use absolute URLs. Always include https:// and the full domain.
  3. Self-referencing is best practice. Every page should canonical to itself, even unique pages.
  4. Point to a 200 OK page. Never point to a 404, redirect or blocked URL.
  5. Use the same protocol. Don't canonical HTTP to HTTPS across a redirect chain unnecessarily.
  6. Don't canonical to a different language version. Use hreflang for that instead.
  7. Keep it consistent. The canonical URL should match your sitemap and internal links.

Common Canonical Mistakes

MistakeProblemFix
Multiple canonicals on one pageGoogle ignores all of themKeep only one, self-referencing
Relative URLMay resolve incorrectly per-pageUse full absolute URL
Canonical points to 404Crawl errors, lost signalsUpdate to a live URL
Canonical to homepage from every pageDeindexes all inner pagesEach page canonical to itself unless it's a true duplicate
Chain of canonicals (A → B → C)Signals get lost in the chainPoint directly to the final canonical
Canonical + noindex combinedContradictory signalsPick one — usually self-canonical, no noindex

Canonical vs Other SEO Tags

  • Canonical — tells search engines the preferred URL for indexing.
  • hreflang — tells search engines which language/region version to show.
  • robots meta noindex — tells search engines to remove the page from the index.
  • 301 redirect — tells browsers and crawlers to move to a new URL permanently. Prefer this over canonical when the old URL should not be reachable.
  • og:url — used by social platforms for the canonical social-share URL.

Pro Tip: Self-referencing canonicals aren't redundant — they actively protect you from URL-parameter duplication, protocol mismatches and unexpected tracking links. Add them to every page, not just pages you think might have duplicates.

Frequently Asked Questions

Yes — as a best practice, every indexable page should have a self-referencing canonical tag. It costs nothing, prevents duplicate-content issues from URL parameters and tracking links, and gives you full control if you ever need to change the preferred URL.

It is technically possible, and it's a legitimate use case for syndicated content (e.g., you republish a partner's article). But Google treats cross-domain canonicals as a hint, not a directive — and only respects them between trusted, related sites. For same-site duplicates, always use same-domain canonicals.

Strip them. A canonical tag should always point to the clean version of the URL, without utm_*, fbclid, gclid or other tracking parameters. This tool's normalization options do that automatically.

Use a 301 redirect when the old URL should no longer be accessible (e.g., you've renamed a page). Use a canonical tag when both URLs must remain live but only one should be indexed (e.g., a product accessible via multiple category paths). For very important pages, use both together.

No. Google treats rel=canonical as a strong hint, not a strict rule. It cross-checks your canonical against other signals — sitemap entries, internal links, redirects and content similarity — and can override your choice if those signals disagree. To maximize trust, keep canonicals, sitemaps and internal links consistent.

Ready to Fix Duplicate Content?

Generate perfect canonical tags, audit existing pages and clean up URL parameters — all in your browser, no registration required.

Updated: January 2026 | Free for Commercial Use | 100% Client-Side Processing

Why Choose Our Canonical Tag Tool?

Smart Normalization

Automatically strip UTM parameters, fragments, default ports and more.

Bulk Mode

Generate canonical tags for dozens of URLs at once — perfect for large sites.

Instant Audit

Paste any HTML and detect multiple, relative or missing canonicals in seconds.

100% Private

Everything runs locally. Your URLs and HTML never leave your browser.

More SEO Tools

', 'text/html'); } else { doc = new DOMParser().parseFromString(raw, 'text/html'); } } catch (e) { addError('Could not parse HTML', 'The browser could not parse the HTML you provided.'); return { issues, passed }; } const canonicals = Array.from(doc.querySelectorAll('link[rel~="canonical" i]')); if (!canonicals.length) { addError('No canonical tag found', 'This document does not contain a tag. Every indexable page should have a self-referencing canonical.', ''); return { issues, passed }; } if (canonicals.length > 1) { addError('Multiple canonical tags (' + canonicals.length + ')', 'Google ignores pages with more than one canonical tag. Remove all but one.', canonicals.map(c => '').join('\n')); } else { passed.push('Exactly one canonical tag is present'); } canonicals.forEach((link, idx) => { const href = (link.getAttribute('href') || '').trim(); const label = canonicals.length > 1 ? 'Canonical #' + (idx + 1) + ': ' : 'Canonical: '; if (!href) { addError(label + 'Empty href', 'The canonical tag exists but has no href attribute value.', ''); return; } // Relative URL check if (!/^https?:\/\//i.test(href) && !href.startsWith('//')) { addWarn(label + 'Relative URL', 'Canonical URLs should be absolute (include https:// and full domain) to avoid resolution errors.', 'href="' + href + '" → use a full https:// URL'); } else { passed.push(label + 'Uses an absolute URL'); } // Fragments if (href.indexOf('#') !== -1) { addWarn(label + 'Contains a #fragment', 'Canonical URLs should not include fragments — search engines ignore everything after #.', href.split('#')[0]); } // Tracking params const urlPart = href.split('?')[1] || ''; if (urlPart && /(^|&)(utm_|fbclid|gclid|msclkid|mc_cid|mc_eid|ref=|ref_src|igshid|yclid)/i.test(urlPart)) { addWarn(label + 'Contains tracking parameters', 'Canonical URLs should point to the clean version. Strip utm_*, fbclid, gclid and similar.', href.replace(/[?&](utm_[^&]*|fbclid=[^&]*|gclid=[^&]*|msclkid=[^&]*|mc_cid=[^&]*|mc_eid=[^&]*|ref=[^&]*|ref_src=[^&]*|igshid=[^&]*|yclid=[^&]*)/g, '').replace(/[?&]$/, '')); } // HTTP vs HTTPS if (/^http:\/\//i.test(href)) { addWarn(label + 'Uses HTTP instead of HTTPS', 'Modern sites should canonical to HTTPS. If you use HTTPS site-wide, update the canonical URL.', href.replace(/^http:/i, 'https:')); } // Localhost if (/(:\/\/localhost|:\/\/127\.0\.0\.1|:\/\/0\.0\.0\.0)/i.test(href)) { addError(label + 'Points to a local address', 'Never canonical to localhost or 127.0.0.1 in a production page.', ''); } // Self-reference check: cannot verify against live URL, but compare with or og:url if present // We do a heuristic: if there's a and they differ, warn const ogUrl = doc.querySelector('meta[property="og:url" i]'); if (ogUrl) { const ogHref = (ogUrl.getAttribute('content') || '').trim(); if (ogHref && ogHref !== href) { addWarn(label + 'Does not match og:url', 'The canonical href and og:url differ. They should normally match.', 'canonical: ' + href + '\nog:url: ' + ogHref); } } }); // Check noindex conflict const robotsMeta = doc.querySelector('meta[name="robots" i]'); if (robotsMeta) { const content = (robotsMeta.getAttribute('content') || '').toLowerCase(); if (content.indexOf('noindex') !== -1) { addError('Canonical + noindex conflict', 'This page contains both a canonical tag and a noindex directive. Google may ignore the canonical or fail to index the target.', 'Remove OR remove the canonical tag, then re-check.'); } } // Check protocol consistency const canonicalHref = (canonicals[0].getAttribute('href') || '').trim(); if (canonicalHref && /^https:\/\//i.test(canonicalHref)) { passed.push('Canonical uses HTTPS'); } return { issues, passed }; } function renderValidatorResults(container, result) { const errors = result.issues.filter(i => i.severity === 'error'); const warnings = result.issues.filter(i => i.severity === 'warning'); const isClean = errors.length === 0; const score = Math.max(0, Math.round(100 - errors.length * 25 - warnings.length * 8)); const scoreColor = score >= 90 ? 'text-green-500' : score >= 70 ? 'text-blue-500' : score >= 40 ? 'text-yellow-500' : 'text-red-500'; let html = ''; html += `
${isClean ? 'CANONICAL OK' : 'ISSUES FOUND'}

${errors.length} error(s) · ${warnings.length} warning(s) · ${result.passed.length} passed

${score}%
Score
`; if (errors.length) { html += '

Errors

'; html += '
'; errors.forEach(i => { html += issueRow(i, 'error'); }); html += '
'; } if (warnings.length) { html += '

Warnings & recommendations

'; html += '
'; warnings.forEach(i => { html += issueRow(i, 'warning'); }); html += '
'; } if (result.passed.length) { html += '

Passed

'; html += '
'; result.passed.forEach(p => { html += `
${esc(p)}
`; }); html += '
'; } container.innerHTML = html; } function issueRow(issue, severity) { const icon = severity === 'error' ? 'fa-circle-xmark text-red-500' : 'fa-triangle-exclamation text-yellow-500'; const codeBlock = issue.code ? '
' + esc(issue.code) + '
' : ''; return `
${esc(issue.title)}
${esc(issue.detail)}
${codeBlock}
`; } $('validate-btn').addEventListener('click', function () { const html = $('validator-input').value; if (!html.trim()) { showToast('Please paste some HTML first'); return; } const result = validateCanonical(html); renderValidatorResults($('validator-results'), result); }); $('validator-sample-btn').addEventListener('click', () => { $('validator-input').value = [ '', '', '', ' ', ' My Page', ' ', ' ', ' ', '', '

Hello

', '' ].join('\n'); }); $('validator-clear-btn').addEventListener('click', () => { $('validator-input').value = ''; $('validator-results').innerHTML = `

Paste HTML and click Validate Canonical to see the full report.

`; }); /* ================= FOOTER TOGGLE ================= */ document.querySelectorAll('.footer-toggle-btn').forEach(btn => { btn.addEventListener('click', function () { if (window.innerWidth > 768) return; const content = this.nextElementSibling; if (content && content.classList.contains('footer-col-content')) { content.classList.toggle('collapsed'); } }); }); /* ================= INIT ================= */ // Auto-generate on load with the default URL if ($('canonical-url').value) { generateCanonical(); }