AI Tools Free

Canonical Tag Generator

Paste any absolute URL into the Canonical Tag Generator below to strip UTM tracking parameters and URL fragments, normalize trailing slashes, and generate both the HTML <head> tag and HTTP Link header.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Generate Canonical Tag.

Enter the full absolute URL starting with https:// or http://.

Remove marketing tracking parameters that create duplicate URL variations.

Match your site's canonical URL trailing-slash convention.

Normalize uppercase URL path characters to prevent case-split duplicates.

Your result
Enter your details

Result will appear here

How Canonical Tag Generator works

The Canonical Tag Generator parses your URL using the WHATWG URL standard, verifies an explicit http:// or https:// scheme, strips #hash fragments, filters query parameters per your rule, applies trailing-slash and case normalization, and outputs HTML-escaped markup.

<link rel="canonical" href="https://domain.com/normalized-path">

Also generates the RFC 6596 HTTP response header (Link: <URL>; rel="canonical") for PDFs and non-HTML resources, plus Next.js/React metadata syntax.

Canonical Tag Generator workflow overview
Workflow overview for Canonical Tag Generator.

Canonical Tag Generator Quick Reference & Input Guide

Review the input parameters, allowed value ranges, and worked reference cases for the Canonical Tag Generator below before running your calculation.

Parameter / ScenarioDefault / Sample ValueRule or Allowed RangeOutput / Usage Note
Input: Target page URL (absolute http/https)https://aitoolsfree.net/tools/can...Enter the full absolute URL starting with https:// or http://.Required workspace parameter
Input: Query parameter cleanuptrackingOptions: Strip tracking params (utm_*, fbclid, gclid, msclkid, _ga), Strip all query parameters (?...), Keep all query parameters intactRequired workspace parameter
Input: Trailing slash policy (on non-root paths)preserveOptions: Preserve input trailing slash, Remove trailing slash (/tools/slug/ -> /tools/slug), Enforce trailing slash (/blog/post -> /blog/post/)Required workspace parameter
Input: Path case normalizationyesOptions: Lowercase hostname & path, Lowercase hostname only (preserve path case)Required workspace parameter
Worked Case 1: Cleaning a newsletter campaign URL with UTM params and #pricing hashPreloaded / test valuesCanonical URL = Origin + NormalizedPath + FilteredQuery (always stripping #fragment per RFC 6596); Tag = <link rel="canonical" href="EscapedURL">Inputting 'https://aitoolsfree.net/tools/canonical-tag-generator?utm_source=newsletter&utm_medium=email#pricing' removes 2 UTM parameters and the '#pricing' fragment, outputting <link rel="canonical" href="https://aitoolsfree.net/tools/canonical-tag-generator">.
Worked Case 2: Preserving pagination (?page=2) while stripping gclidPreloaded / test valuesCanonical URL = Origin + NormalizedPath + FilteredQuery (always stripping #fragment per RFC 6596); Tag = <link rel="canonical" href="EscapedURL">In 'Strip tracking params' mode, 'https://example.com/Catalog/?page=2&gclid=test123' lowercases '/Catalog/' to '/catalog/', strips 'gclid', and keeps '?page=2'.

How to use Canonical Tag Generator step by step

Clean up campaign URLs or verify your template's canonical convention before deploying.

Enter a full https:// or http:// URL

Paste your target URL including scheme and domain (relative URLs without http/https are flagged with an error).

Canonical Tag Generator step 1: Enter a full https:// or http:// URL
Step 1 workflow overview for Canonical Tag Generator.

Select query parameter and trailing-slash rules

Choose whether to strip tracking params (utm_*, gclid, fbclid), strip all query strings, or keep query strings, and set your trailing-slash policy.

Canonical Tag Generator step 2: Select query parameter and trailing-slash rules
Step 2 workflow overview for Canonical Tag Generator.

Copy the HTML <link> tag or HTTP header

Click Generate Canonical Tag to inspect the cleaned URL, removed parameters/fragments, HTML <head> tag, and HTTP Link header.

Canonical Tag Generator step 3: Copy the HTML <link> tag or HTTP header
Step 3 workflow overview for Canonical Tag Generator.

Worked examples for Canonical Tag Generator

See how campaign URLs with UTM tags and hash fragments normalize into clean canonical tags.

Cleaning a newsletter campaign URL with UTM params and #pricing hash

Inputting 'https://aitoolsfree.net/tools/canonical-tag-generator?utm_source=newsletter&utm_medium=email#pricing' removes 2 UTM parameters and the '#pricing' fragment, outputting <link rel="canonical" href="https://aitoolsfree.net/tools/canonical-tag-generator">.

Canonical Tag Generator example 1: Cleaning a newsletter campaign URL with UTM params and #pricing hash
Worked example 1 for Canonical Tag Generator.

Preserving pagination (?page=2) while stripping gclid

In 'Strip tracking params' mode, 'https://example.com/Catalog/?page=2&gclid=test123' lowercases '/Catalog/' to '/catalog/', strips 'gclid', and keeps '?page=2'.

Canonical Tag Generator example 2: Preserving pagination (?page=2) while stripping gclid
Worked example 2 for Canonical Tag Generator.

Keep only one canonical declaration per page

Place the generated <link rel="canonical"> tag inside <head> (never inside <body>) and ensure your CMS does not emit a second conflicting canonical tag.

Canonical Tag Generator example 3: Keep only one canonical declaration per page
Worked example 3 for Canonical Tag Generator.

How to interpret the Canonical Tag Generator output

Review the Normalized Canonical URL and the cleanup audit before pasting the tag into your template.

The headline result displays the ready-to-paste HTML <link rel="canonical"> tag. Breakdown cards show the normalized URL, protocol check (HTTPS vs. HTTP), parameters stripped count, fragment removed status, and the HTTP Link header.

How to interpret Canonical Tag Generator results
Result interpretation guide for Canonical Tag Generator.

Input limits, assumptions, and related tools

Verify that your canonical target returns HTTP 200 and is not blocked by robots.txt or noindex.

Relative paths (like '/tools/slug' without 'https://domain.com') are rejected because canonical tags should always specify the full scheme and hostname. Make sure the canonical URL you output actually resolves with HTTP 200 on your server rather than a 301 redirect or 404.

Scope limits and assumptions for Canonical Tag Generator
Assumptions and input boundaries for Canonical Tag Generator.

Canonical Tag Generator: common questions

Answers about using Canonical Tag Generator and understanding its results.

Why must a canonical tag use an absolute URL instead of a relative path?

While HTML allows relative paths in <link> elements, Google Search Central explicitly recommends using full absolute URLs (including https:// and your domain name) in rel="canonical" to prevent misinterpretation when pages are scraped or served across staging domains.

Why does the Canonical Tag Generator always remove URL #fragments?

Search engines do not index URL hash fragments (such as #section-2) as separate pages and Google Search Central states that fragments are not supported in rel="canonical". The generator strips #fragments automatically.

When should I use the HTTP Link: rel="canonical" header instead of the HTML <link> tag?

Use the HTML <link rel="canonical"> tag inside <head> for standard HTML web pages, and use the HTTP response header (Link: <https://...>; rel="canonical") for non-HTML documents like downloadable PDF files.

Which tracking parameters are removed in 'Strip tracking params' mode?

It strips utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id, gclid, fbclid, msclkid, twclid, mc_cid, mc_eid, and _ga while preserving functional query parameters like ?page=2.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Generate Canonical Tag