Canonical URL Generator

Canonical URL—

How Canonical URL Generator is calculated: Canonical = https:// + clean domain + path without trailing slash + only the non-tracking query parameters (utm_*, fbclid, gclid, mc_cid, ref, fbp, msclkid stripped)

What is a canonical URL generator?

A canonical URL is the one clean address you want search engines to treat as the real address of a page. The same page can be reached through many addresses: with and without a trailing slash, with tracking codes added by an advert, with a referral tag added by a social app, with a session code added by a shopping cart. To a search engine, each of those looks like a different page, and the links and authority they earn get split between copies instead of adding up on one page.

The canonical tag tells the search engine which address counts. It is a line in the page's head that names the clean address, and a search engine that finds five copies of a page follows the tag and treats the named address as the real one. The tag does not delete the other addresses — they still load — but it stops them from competing with the real page in search results.

This generator builds that clean address for you. Type the domain, the path of the page, and the query string to clean, and it strips the tracking parameters, fixes the trailing slash, and returns the canonical URL — both in the results box and in the output box, ready to copy into the tag. Everything runs in your browser, and nothing is uploaded.

How this canonical URL generator works

The generator builds the address in four steps. First it cleans the domain: it strips any http:// or https:// you pasted, removes a leading www., and takes only the part before the first slash, so a pasted homepage address still works. The domain is lowercased, because domain names are not case-sensitive and a mixed-case domain in a canonical tag is a needless difference.

Second it cleans the path. A missing leading slash is added, so blog/guide becomes /blog/guide. A trailing slash is removed, except on the homepage itself, so /blog/guide/ becomes /blog/guide — the two addresses load the same page, and the canonical tag must pick one. Third it reads the query string you pasted and drops the tracking parameters: anything starting with utm_, plus fbclid, gclid, mc_cid, ref, fbp, and msclkid. Fourth it keeps any parameter that is not tracking — a page number, a sort order, a filter — because those change what the page shows, and a canonical address that drops them would point at the wrong content.

The result is assembled as https:// followed by the domain, the path, and the kept parameters. The sample on this page turns the domain example.com, the path /blog/filter-coffee-guide, and the query ?utm_source=google&utm_medium=cpc&ref=home into https://example.com/blog/filter-coffee-guide — every parameter in that query was tracking, so nothing is kept. The formula box on this page states the method in one line.

Tracking parameters, explained

A tracking parameter is a piece of a URL that records where a visitor came from, without changing the page. The utm_ family is the most common: utm_source says the source, like google or newsletter; utm_medium says the channel, like cpc or email; utm_campaign names the campaign. They are added by adverts, email tools, and social apps, and they are useful for analytics — but they belong in analytics, not in a canonical address. A search engine that indexes the address with the tracking codes treats it as a separate page.

The other parameters the generator strips are the platform tags: fbclid is added by Facebook, gclid by Google Ads, msclkid by Microsoft Ads, mc_cid by Mailchimp, and ref is a generic referral tag used by many sites. None of them changes the page; all of them create a duplicate address. Stripping them is safe, because the analytics tools that added them read the codes from the visit itself, not from the canonical tag.

The parameters the generator keeps are the ones that change the content. A page number, like ?page=2, shows different items from ?page=1, so it must survive — a canonical address without it would claim that page two is the same as page one. A sort order, a filter, or a search term is the same: if removing the parameter changes what the reader sees, the parameter stays. The rule is simple: tracking goes, content stays.

A worked example: cleaning a coffee guide address

Take the defaults loaded on this page. The domain is example.com, the path is /blog/filter-coffee-guide, and the query is ?utm_source=google&utm_medium=cpc&ref=home. Every parameter in that query is tracking — two utm_ codes and a ref — so the generator drops all three and returns https://example.com/blog/filter-coffee-guide. The results box shows the same address, and the output box holds it ready to copy into the canonical tag.

Try a path with a trailing slash next. Change the path to /blog/guide/ and leave the query empty, and the generator returns https://example.com/blog/guide — the slash is gone, because the canonical address picks one form and sticks to it. The homepage is the exception: a path of / stays as /, because the homepage address without a slash is the bare domain, and that is a different form again.

Try a mixed query to see what is kept. A path of /blog with the query ?page=2&utm_medium=cpc returns https://example.com/blog?page=2 — the tracking code is dropped, but the page number is kept, because page two shows different content from page one. That is the generator's judgement in action: it strips what records the visit and keeps what shapes the page.

Why canonical URLs matter

Duplicate addresses split a page's strength. If five copies of a guide each earn a few links, no single copy earns enough to rank well — the links are spread across five addresses that all show the same content. A canonical tag gathers them: the search engine follows the tag, treats the named address as the real page, and counts the links toward it. The copies still exist, but they stop competing with the page they copy.

Canonical tags also stop the wrong address from appearing in search results. Without one, a search engine may show the address with the tracking codes — a long, ugly link with utm_source and fbclid in it — instead of the clean address, because that was the copy it happened to crawl first. Readers trust a clean address more, and they are more likely to click it and to share it. A clean address in the results is part of the page's presentation, not just its plumbing.

The tag matters most on sites with adverts, email campaigns, and social sharing, because those are the sources of tracking codes. A page shared on Facebook gains a fbclid; the same page in a Google advert gains a gclid; the same page in a newsletter gains utm_ codes. Each share creates a new address for the same page, and without a canonical tag each one is a new page in the search engine's eyes. A meta tag generator builds the other tags in the page head, and the canonical tag sits beside them.

Canonical URL generator vs sitemap generator: different jobs

This generator and a sitemap generator both deal with addresses, but they do different jobs. The canonical generator cleans one address — it takes a messy URL and returns the single clean form a page should be known by. The sitemap generator lists every page on the site in one file, so search engines can find them all. One fixes an address; the other inventories the site.

A page can be in the sitemap and still have a canonical problem. The sitemap lists the clean address, but visitors still arrive through tracking-coded copies, and without a canonical tag on the page itself, the search engine has no instruction to prefer the clean address. The sitemap tells the search engine the page exists; the canonical tag tells it which address counts.

Use both together. The sitemap lists the clean addresses of all your pages, and the canonical tag on each page confirms its own clean address. When the two agree — the sitemap lists https://example.com/blog/filter-coffee-guide and the page's tag names the same address — the search engine has no reason to doubt which address is real. A sitemap generator builds that list, and this generator builds the address each tag should name.

Common mistakes with canonical URLs

The most common mistake is having no canonical tag at all. A page with no tag leaves the search engine to guess which copy is real, and the guess is often the copy with the tracking codes, because that was the copy that got shared. Every page deserves a canonical tag naming its own clean address, even a page that has no duplicates yet — the tag costs nothing and prevents the problem before it starts.

The second mistake is a canonical tag that points at the wrong address: a tag on a guide page that names the homepage, or a tag that names an address with tracking codes still in it. A tag that points elsewhere tells the search engine the page is a copy of that other address, and the page can vanish from results entirely. The tag must name the page it sits on, in its clean form — which is exactly what this generator returns.

The third mistake is mixing the slash forms. A site where half the pages end in a slash and half do not, with tags that disagree, gives the search engine two versions of every page and no clear instruction. Pick one form — no trailing slash, except the homepage — and use it in the sitemap, in the internal links, and in the tag. A robots.txt generator is a different tool again — it tells crawlers which parts of the site they may visit, not which address counts.

How to use this canonical URL generator

First, type the domain — example.com, without https:// or www. Then type the path of the page, like /blog/filter-coffee-guide. Then paste the query string to clean, like ?utm_source=google&utm_medium=cpc&ref=home, or leave it empty if the address has no query. The clean canonical URL appears in the results box and in the output box, updating live as you type.

Copy the address from the output box and paste it into the canonical tag in the page head: a link tag with rel set to canonical and href set to the address. Check that the tag names the page it sits on, in its clean form, with no tracking codes and no trailing slash. A title tag checker can confirm the title on the same page while you are in the head section.

Nothing you type is uploaded or stored: the cleaning runs entirely in your browser, and closing the page deletes everything. Use the generator whenever a page gains a new tracking code — a new advert, a new email campaign, a new social share — and check that the canonical tag still names the clean address after every site change.

Frequently Asked Questions

The one clean address of a page — the domain, the path, and only the query parameters that change the content, with all tracking codes stripped and no trailing slash. It is the address the canonical tag in the page head should name, so search engines treat it as the real address and do not split the page's links across duplicate copies.

Tracking parameters — anything starting with utm_, plus fbclid, gclid, mc_cid, ref, fbp, and msclkid — are dropped, because they record where a visitor came from without changing the page. Parameters that change the content, like a page number (?page=2) or a sort order, are kept, because removing them would point at different content.

No. The cleaning runs entirely in your browser on the text you type. Nothing is uploaded, nothing is stored, and closing the page deletes everything. The canonical tag itself must be added to your page's head by you — this tool only builds the address the tag should name.

Keep it. A page number changes what the page shows — page two lists different items from page one — so the canonical address for page two must include ?page=2. Stripping it would claim that page two is the same as page one, which is wrong. The rule is simple: tracking goes, content stays.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.