ToolNimba

๐Ÿ”— Canonical Tag Generator: Build a rel=canonical Link Tag

Shihab Mia By Shihab Mia ยท Reviewed by ToolNimba Editorial Review, technical SEO content ยท Updated 2026-06-28

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 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 canonical tag 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. A canonical tag, written as <link rel="canonical" href="...">, solves this by naming a single preferred canonical url that should receive the ranking signals, so the duplicates consolidate instead of cannibalising each other. A canonical tag generator like this one removes the guesswork by producing the exact rel canonical markup you need in seconds.

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 url. It will ignore one that contradicts the rest of your signals, for example a canonical link tag 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 XML sitemap, and the one your redirects resolve to. When those signals fight each other, Google picks its own canonical and your chosen URL may be quietly demoted to a duplicate.

The safest output from any canonical tag generator 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. A self-referencing canonical 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, such as a filtered category view that should defer to the clean category URL.

The rel canonical element is not the only way to declare a canonical url, and knowing the alternatives helps you choose the right one. You can send the same instruction in the HTTP Link header, which is the standard approach for non-HTML files such as PDFs where there is no <head> to edit. For large sites the XML sitemap acts as a softer canonical signal, and a 301 redirect is the strongest option of all when the duplicate URL never needs to be reachable. This tool focuses on the HTML link element because it is the most common, the easiest to audit, and the one most content management systems expect, but the cleaned URL it produces is equally valid in a Link header.

Getting the canonical url right matters most on commerce, publishing and faceted-navigation sites, where a single template can spawn thousands of parameter combinations. Faceted filters (color, size, price, sort order), session identifiers, pagination, and campaign tracking codes all multiply the URL count without adding unique content. Left unmanaged, this dilutes crawl budget and splits link equity across near-identical pages. A disciplined canonical strategy, paired with this canonical tag generator to keep the markup consistent, tells search engines exactly where to concentrate their attention and helps the page you actually care about rank.

Finally, remember that a canonical link tag works alongside, not instead of, the rest of your technical SEO. Hreflang annotations must each reference their own self-referencing canonical, mobile and desktop variants should canonicalise to a single responsive URL, and syndicated content should canonicalise back to the original publisher when you want them to keep the credit. Treat the canonical url as one disciplined signal in a coherent set, validate it after deployment with a tool such as Google Search Console URL Inspection, and you will avoid the duplicate content fix headaches that catch out so many sites.

When to use it

  • Pointing parameter-laden URLs (filters, sorting, session IDs, UTM tags) back to a single clean product or article URL so ranking signals consolidate.
  • Adding a self-referencing canonical to every page so crawlers always have an unambiguous preferred canonical url.
  • Consolidating http, https, www and non-www variants onto one chosen version while server-side redirects are still being set up.
  • Telling search engines which version of syndicated or reprinted content is the original source via a cross-domain canonical.
  • Handling print-friendly, mobile or AMP-style alternate pages that should not rank separately from the main page.
  • Generating consistent canonical link tag markup for a large faceted-navigation catalog where the same template produces thousands of URL variations.

How to use the Canonical Tag Generator

  1. Paste the full URL of the page, including https:// (a bare domain is assumed to be https).
  2. Choose whether to strip the query string, remove the fragment, and lowercase the domain. Leaving these on gives the cleanest canonical.
  3. Read the generated <link rel="canonical"> tag in the result box and confirm it points to the URL you intend.
  4. Click Copy and paste the canonical link tag inside the <head> section of the page it refers to.
  5. Deploy the page, then validate the canonical url with Google Search Console URL Inspection to confirm the chosen URL is the one Google selects.

Formula & method

<link rel="canonical" href="ABSOLUTE_URL" /> where ABSOLUTE_URL is the full, preferred address of the page (scheme + domain + path), normally pointing the page at itself.
Canonical Tag GeneratorMany duplicate URLs consolidate into one preferred canonical/page?utm_source=newshttp://www.site.com/page/page#reviews/PAGE/ (trailing slash)<link rel="canonical"href="https://site.com/page" />One absolute, self-referencing URLgets all the ranking signalsStrip tracking params, lowercase domain, drop fragments, then place in <head>

Worked examples

A blog post is shared with a UTM tag: https://example.com/blog/my-post?utm_source=newsletter

  1. Trim whitespace and confirm the scheme is https.
  2. With "Remove query string" on, drop ?utm_source=newsletter.
  3. Lowercase the domain (already lowercase here).
  4. 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

  1. Lowercase the domain so Shop.Example.com becomes shop.example.com.
  2. With "Remove fragment" on, drop #reviews (fragments are never part of a canonical).
  3. Keep the path case as-is, since paths can be case-sensitive on some servers.
  4. Build the canonical link tag from the normalised URL.

Result: <link rel="canonical" href="https://shop.example.com/Item" />

An article is republished on a partner site but should credit the original: original at https://example.com/news/launch, republished at https://partner.com/launch

  1. On the partner page, set the canonical to the original publisher URL, not the partner URL.
  2. Use an absolute cross-domain canonical so the credit crosses sites correctly.
  3. Leave the original page with a self-referencing canonical pointing to itself.
  4. Confirm both sides agree so signals are not contradictory.

Result: <link rel="canonical" href="https://example.com/news/launch" />

Common duplicate-URL situations and the canonical to use

SituationPreferred canonical target
Same page with UTM / tracking paramsThe clean URL without the query string
www vs non-www versionsYour one chosen host, used everywhere
http vs httpsAlways the https version
Trailing slash vs no slashWhichever form your site uses consistently
Paginated list (page 2, 3, ...)Self-referencing on each page, not page 1
Print or AMP alternateThe main, indexable page
Faceted filter / sort variantThe clean base category URL
Syndicated / republished articleThe original publisher URL (cross-domain)

Where rel=canonical fits among related SEO directives

Tag / directiveWhat it does
rel="canonical"Names the preferred URL among duplicates; a hint to consolidate signals.
301 redirectPermanently sends users and crawlers to another URL; stronger than a canonical.
meta robots noindexAsks search engines to keep the page out of the index entirely.
robots.txt DisallowBlocks crawling of a path; can stop the canonical from being seen.
HTTP Link headerDeclares a canonical for non-HTML files such as PDFs where there is no head.
hreflangMaps language and region variants; each must self-reference its own canonical.

Canonical tag dos and donts at a glance

DoAvoid
Use absolute URLs with scheme and domainRelative paths like /page
One canonical per pageMultiple or conflicting canonicals
Point to a live 200-OK indexable pagePointing to noindex, 404 or blocked pages
Match canonical, internal links and sitemapMixed signals across sources
Self-reference unique and paginated pagesCollapsing pagination onto page 1

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.
  • Placing the canonical tag in the body instead of the head. A canonical link tag is only valid inside the <head>. If JavaScript injects it into the <body>, or it appears after the opening <body> tag, Google ignores it. Render it server-side in the head where possible.

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.
Cross-domain canonical
A canonical that points to a URL on a different domain, used to credit the original source of syndicated content.

Frequently asked questions

What is a canonical tag?

A canonical tag is the <link rel="canonical" href="..."> element you place in a page 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 canonical url instead of splitting them across duplicates.

Where do I put the canonical tag?

Place it inside the <head> section of the page 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 link 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 for any canonical tag generator output.

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. Use a redirect when the duplicate never needs to be reachable, and a canonical when both URLs must stay live.

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.

How do I handle canonical tags for pagination?

Give each paginated page (page 2, page 3 and so on) a self-referencing canonical pointing to itself, because each page shows different items and is not a duplicate of page 1. Do not canonicalise the whole series back to page 1, or the deeper pages may drop out of the index. Google retired rel=prev/next as an indexing signal, so self-referencing canonicals plus good internal linking are the modern approach.

Can a canonical tag point to a different domain?

Yes. A cross-domain canonical points the canonical url to a page on another site, which is how you credit the original publisher of syndicated or republished content. Use an absolute URL, make sure the original page allows indexing, and confirm both sites agree so the signal is not contradicted.

How do canonical tags interact with hreflang?

Each language or region variant should carry a self-referencing canonical pointing to itself, and the hreflang annotations should reference those same self-referencing URLs. Do not canonicalise all language versions to a single master, because that tells Google to drop the alternates from the index instead of treating them as locale variants.

Should query string parameters be in the canonical URL?

Usually not. Tracking parameters such as utm_source and session IDs create duplicate URLs and should be stripped so the canonical points to the clean address, which is exactly what this canonical tag generator does by default. Keep only parameters that genuinely change the page content, for example a parameter that selects a distinct product variant you want indexed on its own.

Sources