Done!

Canonical URL Generator

Build canonical link tags, clean URLs, strip tracking params, and generate hreflang tags — all in one place.

Canonical Tag Generator Live

Enter URL
Paste any URL — tracking params, fragments, and case will be handled by the options below.
Please enter a valid URL starting with http:// or https://
Canonicalization Options
Force HTTPS — upgrade http:// to https://
Remove www — strip www. prefix
Add www — prepend www. to domain
Remove trailing slash — strip ending /
Force trailing slash — add ending /
Lowercase path — normalize URL casing
Remove fragment — strip #hash from URL
Remove all query params — strip entire ?query
Remove UTM params only — strip utm_* params
Remove common tracking params — ref, fbclid, gclid…
Sort query params — alphabetical order
Additional params to remove (comma-separated)
Enter a URL on the left to generate the canonical tag

What Is a Canonical URL and Why Does It Matter for SEO?

A canonical URL is the preferred version of a web page that you want search engines to index when multiple URLs contain the same or very similar content. You declare it using the <link rel="canonical" href="..."> tag inside your page's <head>. Google and other search engines treat this as a strong hint — not a directive — to consolidate ranking signals toward that preferred URL. Without a canonical tag, search engines may pick any duplicate version to index, potentially splitting your link equity across several URLs.

When to Use Canonical Tags

  • Tracking parameters: When analytics platforms append ?utm_source=google to URLs, each variant looks like a different page to crawlers. Canonicalize to the clean URL without any UTM or tracking parameters.
  • www vs non-www: https://www.example.com and https://example.com are technically different URLs. Pick one and canonicalize consistently across your entire site.
  • HTTP vs HTTPS: If both protocols are accessible, the HTTPS version should always be the canonical.
  • Trailing slash: /page and /page/ are different URLs to search engines. Choose one convention and enforce it site-wide.
  • Paginated content: For page 2+ of a paginated series, use canonical tags pointing to the paginated URL itself, not page 1.
  • Syndicated content: If your content is republished on another site, ask them to add a canonical pointing back to your original URL to preserve your ranking signals.

Canonical vs 301 Redirect

A 301 redirect permanently moves a URL — browsers and search engines follow it automatically, and users never see the old URL. A canonical tag is a softer signal that keeps both URLs accessible while telling search engines your preference. Use 301 redirects when a page has permanently moved and you want to eliminate the old URL entirely. Use canonical tags when you need both URLs to remain accessible, such as for session-based URLs, AMP pages, and print versions.

Self-Referencing Canonicals

Every page — not just duplicates — should have a self-referencing canonical tag. This prevents other sites from inadvertently specifying a different canonical for your page by linking to a URL with tracking parameters appended. It also protects you if someone scrapes your content: your canonical tag tells Google which site originally published it.

What Is hreflang?

The hreflang attribute tells Google which language and regional variant of a page should be shown to users in specific locales. For example, hreflang="en-GB" targets English-speaking users in the UK, while hreflang="en-US" targets the US. You must include an x-default entry pointing to the fallback version, and every page in the hreflang set must reference all other pages — forming a complete bidirectional reference loop.

How to Generate a Canonical Tag

1
Paste Your URL

Enter any URL — including ones with UTM parameters, tracking IDs, fragments, or mixed casing. The tool automatically prepends https:// if no protocol is specified.

2
Configure Options

Toggle the canonicalization rules you need: force HTTPS, remove or add www, handle trailing slashes, lowercase the path, strip UTM and tracking parameters, remove fragments, or sort query parameters.

3
Copy the Tag

The canonical link tag is generated live as you type. Click Copy to grab the <link rel="canonical"> tag, the clean URL, Open Graph/Twitter Card tags, or the complete head snippet ready to paste into your HTML.

4
Review Changes

The "What Was Changed" section shows a before/after diff of every transformation applied, so you can verify the canonical is exactly correct before implementing it.

5
Generate hreflang or Bulk Tags

Switch to the hreflang tab to build international SEO tags, or the Bulk tab to generate canonical tags for multiple URLs at once using the same settings.

Frequently Asked Questions

What is a canonical URL?
A canonical URL is the preferred version of a web page that you declare to search engines using the <link rel="canonical" href="..."> HTML tag. It tells Google which URL to index and consolidate ranking signals to when the same content is accessible at multiple URLs.
How do I create a canonical link tag?
Place <link rel="canonical" href="https://example.com/page"> inside the <head> section of your HTML, where the href value is your clean, preferred URL. Use this generator above to automatically clean your URL and copy the correct tag instantly.
Should I remove UTM parameters from my canonical URL?
Yes, always. UTM parameters are tracking-only and should never appear in canonical URLs. Including them creates duplicate content — each UTM variant looks like a different page to search engines, diluting your link equity. Your canonical tag should always point to the clean URL without any UTM parameters.
What is the difference between a canonical tag and a 301 redirect?
A 301 redirect permanently moves a URL — browsers and search engines follow it automatically and the old URL becomes inaccessible. A canonical tag is a softer signal that keeps both URLs accessible while telling search engines your preference. Use 301 redirects when a page has permanently moved. Use canonical tags when both URLs need to remain accessible.
Should every page have a canonical tag?
Yes. Every public-facing HTML page should have a canonical tag. Non-duplicate pages should have a self-referencing canonical — one pointing to the page's own clean URL. This protects against external sites creating unintended duplicate versions by linking to your page with tracking parameters appended.
What tracking parameters should I remove from canonical URLs?
Remove all UTM parameters (utm_source, utm_medium, utm_campaign, etc.) and platform click IDs including fbclid (Facebook), gclid (Google Ads), msclkid (Microsoft Ads), ttclid (TikTok), twclid (Twitter/X), and general tracking params like ref and referrer. This generator strips all of these automatically.
Should canonical URLs include trailing slashes?
/page and /page/ are treated as different URLs by search engines. Either convention is acceptable, but you must be fully consistent across your entire site. Choose one pattern and enforce it in your canonical tags, CMS settings, and server configuration. The homepage (/) is the only URL where a trailing slash is universally standard.
Should I use www or non-www in my canonical URL?
Either is fine, but consistency is essential. Choose one — www.example.com or example.com — and use it in every canonical tag across your site. Also set your preferred domain in Google Search Console to match. Mixing www and non-www across your canonicals creates duplicate content issues.
What is an hreflang tag and when do I need one?
An hreflang tag (<link rel="alternate" hreflang="...">) tells Google which language and regional variant of your page should be shown to users in specific locales. You need hreflang tags if your site serves different language or regional versions of the same content. Every page in an hreflang set must reference all other pages, and you must include an x-default fallback entry.
Can I generate canonical tags for multiple URLs at once?
Yes. Switch to the Bulk tab in this generator and paste multiple URLs — one per line. The tool applies all selected canonicalization options to every URL and generates the full set of <link rel="canonical"> tags, which you can copy or download as an HTML file.