Skip to content
T
Tools.Town
Free Online Tools for Everyone
Canonical Tag Generator illustration

Canonical Tag Generator

100% Free

Generate the correct rel=canonical link tag for any URL — force HTTPS, strip tracking parameters, and normalise the trailing slash.

Valid HTML5
100% Client-Side
No Sign Up
Instant

1Enter your URL

Normalisation options
Trailing slash

2Your canonical tag

HTML tag
<link rel="canonical" href="https://www.example.com/Blog/My-Post">
Canonical URL

https://www.example.com/Blog/My-Post

HTTP header

Link: <https://www.example.com/Blog/My-Post>; rel="canonical"

  • Query string removed — canonical URLs should omit tracking parameters.

Paste the tag inside the <head> of the page it points to.

Embed This Tool

Easy to Embed

Add Canonical Tag Generator to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/canonical-tag-generator/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="Canonical Tag Generator">
</iframe>

Share This Tool

Share Instantly

Share Canonical Tag Generator with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Paste the full URL of the page you want to canonicalise
  2. 2 Choose whether to force HTTPS, strip query strings, and drop the #fragment
  3. 3 Pick how the trailing slash should be handled — keep, add, or remove
  4. 4 Copy the generated <link rel="canonical"> tag
  5. 5 Paste it inside the <head> of the page it points to

Features

  • Builds a valid HTML5 or self-closing XHTML canonical tag
  • Forces HTTPS and lowercases the domain automatically
  • Strips UTM and other tracking query parameters that fragment ranking signals
  • Normalises the trailing slash so /page and /page/ don't compete
  • Also outputs the equivalent HTTP Link header for non-HTML resources
  • Runs entirely in your browser — nothing about your URLs is uploaded

Why it Matters

Search engines treat https://site.com/page, the www version, the http version, and the same URL with a tracking parameter as four different pages — splitting your ranking signals across duplicates. A canonical tag tells crawlers which version is the original, consolidating link equity onto one URL. Getting the syntax exactly right matters, because a malformed canonical can quietly point search engines away from the page you actually want ranked.

★★★★★

Use Cases

Fix Duplicate Content

Point parameterised and printer-friendly variants back to the main page

Clean Tracking URLs

Stop UTM-tagged share links from being indexed as separate pages

Consolidate HTTP/HTTPS

Make sure the secure version is the one search engines rank

Ship Correct Markup

Copy a syntactically valid tag instead of hand-typing it

What this tool does

The Canonical Tag Generator turns any page URL into a correct <link rel="canonical"> tag. It normalises the URL the way search engines prefer — forcing HTTPS, lowercasing the domain, removing tracking query parameters, and fixing the trailing slash — then hands you a copy-paste tag plus the equivalent HTTP Link header.

Why canonicalisation matters

A single page can be reached through many URLs: with and without www, over http and https, with ?utm_source=… appended by a campaign, or with a trailing slash. To a crawler these look like separate pages competing for the same keywords. A canonical tag points them all back to one authoritative URL so your ranking signals stay consolidated.

How to use it

Paste the URL, toggle the normalisation options to match your site’s conventions, choose your trailing-slash rule, and copy the generated tag into the page’s <head>. The output updates instantly as you type.

Privacy

Everything runs locally via the pure generateCanonical function. Your URLs never leave the browser — you can confirm this in the Network tab.

Frequently Asked Questions

What does a rel=canonical tag actually do?
It tells search engines which URL is the master copy of a page when several URLs show the same or very similar content. Crawlers then consolidate ranking signals — links, relevance, freshness — onto the canonical URL instead of splitting them across duplicates.
Where do I put the canonical tag?
Inside the <head> element of the page, ideally near the top before any scripts. Each page should have exactly one canonical tag. You can also serve it as an HTTP Link header for non-HTML files like PDFs — this tool generates that header too.
Should a page point its canonical to itself?
Usually yes. A self-referencing canonical (the page pointing to its own clean URL) is a best practice — it pre-empts duplicates created by tracking parameters or session IDs. Just make sure the canonical URL is the exact, normalised version you want indexed.
Does the canonical URL have to be absolute?
Yes. Google recommends absolute URLs (including the https:// scheme and full domain) for canonical tags. Relative URLs are technically allowed but far more error-prone, so this tool always outputs an absolute URL.
Will a canonical tag remove the duplicate from Google?
A canonical is a strong hint, not a directive — Google usually honours it but may choose a different canonical if signals conflict. For a hard removal, use a noindex tag or a 301 redirect instead.

Related Tools You Might Like

Browse more free tools