A canonical tag exists to answer one question for a search engine: when several URLs can show the same or substantially similar content, which one should be treated as the real one for indexing and ranking. Without it, a product page reachable through a tracking parameter, a session identifier, a mixed case URL and a trailing slash variant all risk being treated as separate pages competing against each other instead of one page collecting all the value in one place.
Everything runs in your browser. Normalising and generating a tag for a URL that has not been deployed yet never sends that URL anywhere. Think of it as a rel canonical generator that also does the normalisation work by hand, rather than one that just wraps whatever URL you paste in a canonical link tag unchanged.
URL normalisation, and why it is not just lowercasing
Normalisation means converting a URL into one consistent form so that variants which are functionally identical are recognised as such. This tool lowercases the scheme and host, since both are case insensitive by definition, while leaving the path case untouched, since path casing is meaningful on most servers and lowercasing it could point the canonical at a URL that does not exist.
It also removes a default port, such as :443 on an https URL, since it changes nothing about which resource is being requested. Trailing slash handling is normalised to match your site's actual convention rather than guessed, since some servers treat /page and /page/ as the same resource and others do not, and getting this wrong points the canonical at a URL that never resolves.
- Scheme and host are lowercased, since both are case insensitive.
- A default port matching the scheme, such as :443 for https, is removed.
- Common tracking parameters are stripped, since they should never appear in a canonical URL.
- Path casing is preserved exactly, since it is meaningful on most servers and guessing wrong breaks the link.
Self referencing canonicals, and why every page needs one
A self referencing canonical is a canonical tag on a page that points at that page's own clean URL. It looks redundant at first glance, since the page is already telling a crawler about itself, but it is standard practice precisely because it is cheap insurance against variants you did not anticipate, such as a parameter appended by a third party link, a case difference introduced by a content management system, or a URL reached through an old redirect chain.
Without a self referencing canonical, any of those variants can be indexed as if it were its own separate page. With one, even if a strange variant of the URL gets crawled somehow, the canonical tag on it points straight back to the clean version, consolidating any ranking signal there instead of splitting it. This is the most common duplicate content fix on the web precisely because it is so cheap to apply on every page at once.
Query parameters and when they belong in a canonical URL
Most query parameters should not appear in a canonical URL. Tracking parameters like utm_source, a session identifier, or a parameter recording where a click came from carry no meaning about the content itself, so a canonical stripped of them correctly tells a search engine that the page with and without the parameter is the same content.
The exception is a parameter that genuinely changes what is shown, such as a page number in pagination or a filter that changes the actual result set. In that case the parameter is part of what makes the page distinct, and stripping it from the canonical would incorrectly tell a search engine to treat a filtered results page and the unfiltered page as identical when they are not.
Cross domain canonicals and syndicated content
A canonical tag can point at a URL on a completely different domain, which is the standard mechanism for handling syndicated content. If your article is republished on a partner site, that partner site should set its canonical to your original URL, telling search engines that your version is the one to index and rank, while the syndicated copy still exists and can send readers back to the source.
This only works correctly if the partner site's owner sets the tag, since a canonical only takes effect on the page it is placed on. There is no way to force a canonical onto content you do not control, which is worth knowing before assuming syndication is automatically safe from duplicate content concerns.
How this canonical tag generator builds the output
The URL you enter is parsed with the browser's own URL object, which handles the edge cases of scheme, host, path, query and fragment parsing correctly rather than relying on a hand rolled regular expression that misses an unusual but valid URL structure. Normalisation rules are applied to the parsed components, and the result is reassembled and escaped before being placed inside the href attribute of the generated link tag.
The output is a single line, ready to place anywhere inside the head element of your page. Order relative to other tags does not matter for a canonical tag specifically, though keeping the canonical link tag near the other indexing related tags, such as robots, makes the head element easier to audit at a glance.
| URL part | Normalised |
|---|---|
| Scheme and host | Lowercased |
| Default port | Removed |
| Tracking parameters | Stripped |
| Path casing | Left exactly as entered |
| Pagination or filter parameters | Left in place, since they change content |
How to use the canonical tag generator
- 1
Paste the URL you consider authoritative
Enter the full URL, including scheme, that should be treated as the canonical version of the page.
- 2
Review the normalised result
Check the cleaned URL, including any stripped tracking parameters and corrected casing on the scheme and host.
- 3
Confirm trailing slash handling matches your server
Toggle the trailing slash option to match how your own server actually resolves the URL.
- 4
Copy the canonical tag
Copy the generated link rel canonical tag and paste it into the head element of the page.
Related tools worth bookmarking
Sources and further reading
- Google Search Central: Consolidate duplicate URLsGoogle's guidance on using canonical tags to handle duplicate content, including when a canonical is ignored.developers.google.com
- MDN: rel=canonicalThe reference for the canonical link relation attribute this generator's output uses, including its syntax and placement.developer.mozilla.org
- RFC 6596: The Canonical Link RelationThe internet standard that formally defines the canonical link relation and the semantics this generator follows.rfc-editor.org
Frequently asked questions
Common questions about the canonical tag generator.
Yes, as standard practice. A self referencing canonical, pointing a page at its own clean URL, protects against duplicate content created by tracking parameters, session identifiers or casing differences you may not anticipate. It costs nothing to include, and running every template through a canonical tag generator once during a site build is the easiest way to guarantee every page gets one.
No. Tracking parameters carry no information about the content itself, so the canonical URL should be the clean version without them. Including a tracking parameter in a canonical tag would incorrectly suggest that URL, tied to one specific marketing campaign, is the single authoritative version of the page, which defeats the purpose of canonicalisation.
Yes, and this is the standard way to handle syndicated content. A partner site republishing your article should set its own canonical tag to point at your original URL, telling search engines to treat your version as authoritative while still allowing the syndicated copy to exist and drive traffic.
Search engines generally ignore a canonical tag pointing at a URL that does not resolve, treating the page as if it had no canonical at all rather than following a broken pointer. This is why URL normalisation matters, since a canonical built with the wrong trailing slash or wrong casing can point at a URL that looks correct but never actually loads.
No. A redirect sends both users and crawlers to a different URL immediately and the original URL stops working as a destination. A canonical tag is a hint for search engines only, the original URL still loads normally for a visitor, and it only affects which version gets indexed and ranked, not where anyone is actually sent. A canonical tag generator like this one only ever produces that hint, never a redirect.
No, that is a common mistake. Each page in a paginated series is genuinely distinct content, so each should have a self referencing canonical pointing at itself, not at page one. Collapsing every page onto page one's canonical tells search engines the later pages do not need to be indexed at all, which can remove them from search entirely.