🔗 Canonical Tag Generator
By ToolNimba SEO Team · Reviewed by ToolNimba Editorial Review, technical SEO content · Updated 2026-06-19
This tool builds the canonical tag from the URL you enter; it does not verify that the target page exists, is indexable, or matches the rest of your site’s signals. Always confirm the canonical points to a live, 200-OK, indexable URL and test important pages with a tool such as Google Search Console. This is general guidance, not a guarantee of any particular search result.
Enter the full address of the page, including https://. This is the version you want search engines to treat as the original.
Enter a URL above to build your canonical tag. Place it in the <head> of the page.
A canonical tag tells search engines which URL is the master copy of a page when several addresses show the same or very similar content. This generator turns any URL into a ready-to-paste <link rel="canonical"> tag, tidying it up first by trimming whitespace, optionally dropping tracking parameters and fragments, and lowercasing the domain. Paste a URL, copy the tag, and drop it into the <head> of the page. Everything runs in your browser, so no URL ever leaves your device.
What is the Canonical Tag Generator?
Duplicate and near-duplicate content is one of the quietest SEO problems. The same product page can be reachable at the http and https versions, with and without a trailing slash, with www and without it, and with a long tail of tracking parameters like ?utm_source=newsletter. To a person these all look like one page, but to a crawler each distinct URL is a separate document competing for the same rankings. The canonical tag, <link rel="canonical" href="...">, solves this by naming a single preferred URL that should receive the ranking signals, so the duplicates consolidate instead of cannibalising each other.
The canonical is a hint, not a directive. Google treats it as a strong signal alongside other clues such as internal links, sitemaps and redirects, and it usually honours a clear, consistent canonical. It will ignore one that contradicts the rest of your signals, for example a canonical pointing to a page that is blocked by robots.txt, returns a 404, or is set to noindex. The most reliable setups keep every signal pointing the same way: the canonical URL is the one you link to internally, the one in your sitemap, and the one your redirects resolve to.
The safest canonical is an absolute, self-referencing URL. Absolute means the full address including the scheme and domain (https://example.com/page), not a relative path like /page, because relative canonicals are easy to resolve incorrectly. Self-referencing means most pages should point their canonical at themselves, which prevents accidental consolidation and makes your intent explicit. You only point the canonical at a different URL when the current page genuinely is a duplicate or variant of that other page.
When to use it
- Pointing parameter-laden URLs (filters, sorting, session IDs, UTM tags) back to a single clean product or article URL.
- Adding a self-referencing canonical to every page so crawlers always have an unambiguous preferred address.
- Consolidating http, https, www and non-www variants onto one chosen version while redirects are still being set up.
- Telling search engines which version of syndicated or reprinted content is the original source.
- Handling print-friendly or AMP-style alternate pages that should not rank separately from the main page.
How to use the Canonical Tag Generator
- Paste the full URL of the page, including https:// (a bare domain is assumed to be https).
- Choose whether to strip the query string, remove the fragment, and lowercase the domain. Leaving these on gives the cleanest canonical.
- Read the generated <link rel="canonical"> tag in the result box.
- Click Copy and paste the tag inside the <head> section of the page it refers to.
Formula & method
Worked examples
A blog post is shared with a UTM tag: https://example.com/blog/my-post?utm_source=newsletter
- Trim whitespace and confirm the scheme is https.
- With "Remove query string" on, drop ?utm_source=newsletter.
- Lowercase the domain (already lowercase here).
- Wrap the cleaned URL in the canonical tag.
Result: <link rel="canonical" href="https://example.com/blog/my-post" />
A product page is reached at a mixed-case, fragmented URL: HTTPS://Shop.Example.com/Item#reviews
- Lowercase the domain so Shop.Example.com becomes shop.example.com.
- With "Remove fragment" on, drop #reviews (fragments are never part of a canonical).
- Keep the path case as-is, since paths can be case-sensitive on some servers.
- Build the tag from the normalised URL.
Result: <link rel="canonical" href="https://shop.example.com/Item" />
Common duplicate-URL situations and the canonical to use
| Situation | Preferred canonical target |
|---|---|
| Same page with UTM / tracking params | The clean URL without the query string |
| www vs non-www versions | Your one chosen host, used everywhere |
| http vs https | Always the https version |
| Trailing slash vs no slash | Whichever form your site uses consistently |
| Paginated list (page 2, 3, ...) | Self-referencing on each page, not page 1 |
| Print or AMP alternate | The main, indexable page |
Where rel=canonical fits among related SEO directives
| Tag / directive | What it does |
|---|---|
| rel="canonical" | Names the preferred URL among duplicates; a hint to consolidate signals. |
| 301 redirect | Permanently sends users and crawlers to another URL; stronger than a canonical. |
| meta robots noindex | Asks search engines to keep the page out of the index entirely. |
| robots.txt Disallow | Blocks crawling of a path; can stop the canonical from being seen. |
Common mistakes to avoid
- Using a relative URL instead of an absolute one. A canonical like href="/page" can be resolved against the wrong base and point somewhere unintended. Always use the full absolute URL with the scheme and domain, for example https://example.com/page.
- Pointing the canonical at a blocked or non-indexable page. If the canonical target is blocked by robots.txt, returns a 404, or carries a noindex tag, search engines will ignore your canonical. The target should be a live, indexable, 200-OK page.
- Setting more than one canonical on a page. A page should have exactly one canonical tag in the <head>. Multiple or conflicting canonicals (for example one in HTML and a different one in the HTTP header) are treated as ambiguous and usually ignored.
- Canonicalising every paginated page to page one. Pages 2, 3 and beyond of a list are not duplicates of page 1. Point each one at itself so its content can be indexed, rather than collapsing the whole series onto the first page.
- Mismatched canonical and internal links. If you link internally to one URL but canonicalise to another, you send mixed signals. Keep the canonical, your internal links and your sitemap all pointing at the same chosen URL.
Glossary
- Canonical URL
- The single preferred address you want search engines to index and rank when several URLs show the same content.
- rel="canonical"
- The link relationship in <link rel="canonical" href="..."> that declares the canonical URL of the page.
- Duplicate content
- Identical or very similar content reachable at more than one URL, which can split ranking signals.
- Self-referencing canonical
- A canonical tag on a page that points to that same page, the default for most unique pages.
- Absolute URL
- A full address including the scheme and domain (https://example.com/page), as opposed to a relative path.
- Query string
- The part of a URL after a question mark, often holding tracking or filter parameters that create duplicate URLs.
- Fragment
- The part of a URL after a hash (#), used to jump to a section. It is never part of a canonical URL.
Frequently asked questions
What is a canonical tag?
A canonical tag is the <link rel="canonical" href="..."> element you place in a page’s <head> to tell search engines which URL is the master version when the same content is reachable at several addresses. It helps consolidate ranking signals onto one preferred URL instead of splitting them across duplicates.
Where do I put the canonical tag?
Place it inside the <head> section of the page’s HTML, ideally near the top alongside your other meta tags. It must be in the <head>; a canonical placed in the <body> is ignored. Each page should have exactly one canonical tag.
Should a canonical URL be absolute or relative?
Use an absolute URL that includes the scheme and domain, such as https://example.com/page. Relative canonicals like /page can be resolved against the wrong base and point somewhere unintended, so absolute URLs are the safe, recommended choice.
Does a canonical tag work like a 301 redirect?
No. A 301 redirect actually sends users and crawlers to a different URL, while a canonical tag leaves the page reachable and only suggests which URL should be indexed. A canonical is a hint that search engines usually honour, whereas a redirect is a firm instruction.
Should every page have a self-referencing canonical?
For most unique pages, yes. A self-referencing canonical (a page pointing its canonical at itself) makes your preferred URL explicit and prevents accidental consolidation. You only point the canonical at a different URL when the current page is genuinely a duplicate or variant of that other page.
Will a canonical tag guarantee that URL gets indexed?
No. The canonical is a strong signal, not a command. Search engines weigh it against your internal links, sitemap and redirects, and they ignore canonicals that point to blocked, missing or noindexed pages. Keeping all your signals consistent gives the canonical the best chance of being respected.
Sources
- Consolidate duplicate URLs with canonicals , Google Search Central
- The Web Linking specification (rel="canonical") , IETF RFC 6596