Canonical Tag Generator — Build rel=canonical HTML Tags
A canonical tag is a single line of HTML that tells Google and other search engines which version of a page URL is the preferred one to index. Without it, a page reachable at multiple addresses can have its search ranking split across duplicates. This often happens with tracking parameters added by ad campaigns, HTTP versus HTTPS variants, or pages with and without a trailing slash. This tool takes any URL you paste in and generates the exact canonical tag HTML, ready to drop into your page head. It also runs a health check on the URL and flags specific problems such as remaining fragments, mixed-case characters, and query strings that could cause duplicate indexing. You can toggle options to force HTTPS, strip query parameters, remove fragment identifiers, and lowercase the path before generating the tag. Use it as part of a technical SEO audit to confirm every page on your site signals the correct canonical URL to search engines.
Input URL: http://MyShop.COM/Products?ref=facebook&utm_source=fb#reviews
Frequently Asked Questions
What is a canonical tag?
A canonical tag is an HTML link element placed in the head of a web page. It tells search engines which URL is the preferred version of that page. When duplicate or near-duplicate content exists at multiple addresses, the canonical tag prevents ranking signals from being split across versions and helps Google index only the intended URL.
Where do I put the canonical tag in my HTML?
Place the canonical tag inside the <head> section of your HTML page, alongside other meta tags. In WordPress, SEO plugins like Yoast SEO or RankMath generate canonical tags automatically. You can also add them manually by editing your theme header file. Search engines will ignore canonical tags placed in the page body.
Should a canonical tag always point to itself?
Yes. Even when no known duplicate URLs exist, every page should carry a self-referencing canonical tag. This tells Google exactly which URL is authoritative, even if a user shares the page with UTM parameters or tracking codes attached. A self-referencing canonical consolidates all link equity to a single URL and protects against scrapers who copy your content to other domains.
What is the difference between a canonical tag and a 301 redirect?
A 301 redirect physically moves users and bots to a new URL, making the old one unreachable. A canonical tag keeps both URLs accessible but signals to search engines which one to index. Use a 301 when a page has permanently moved. Use a canonical when you need parameter or session-based URLs to remain accessible while telling Google to index only the clean version.
Can I set a canonical tag pointing to a different domain?
Yes. Cross-domain canonical tags are fully supported by Google, Bing, and other major search engines. If your content is republished or syndicated on another site, the syndicated copy should include a canonical tag pointing back to the original on your domain. This credits your site as the source and prevents the syndicated copy from competing with or outranking your original page.
What happens if I set the wrong canonical URL?
If you accidentally set a canonical pointing to the wrong page, you tell Google to treat that wrong page as the authoritative version. The correct page may lose ranking, and the wrong page may start gaining authority it does not deserve. Always use absolute URLs in canonical tags (https://example.com/page, not /page) to prevent misinterpretation, and audit your canonicals after any site migration.
How does a canonical tag differ from a 301 redirect?
A 301 redirect actively sends users (and bots) from one URL to another — the old URL stops working. A canonical tag is a hint to search engines about which version is preferred, but the page remains accessible at both URLs. Use a 301 redirect when you have permanently moved a page and want to retire the old URL. Use a canonical when you need duplicate content accessible at multiple URLs for a technical reason (e.g., printer-friendly versions, tracking parameters).
Should canonical tags use HTTP or HTTPS?
Always use HTTPS in canonical tags if your site is served over HTTPS. A canonical pointing to an HTTP URL on an HTTPS site signals inconsistency to search engines and can cause them to treat the two as different URLs. Make sure your canonical, your sitemap URLs, and your internal links all use the same protocol and domain format (with or without www) consistently across the entire site.
How It Works
A canonical tag is a <link> element in the <head> of an HTML page with rel="canonical" and an href pointing to the preferred URL. Search engines read this tag to determine which version of a duplicate or similar page to index. This tool generates the correct tag format, handling the protocol, trailing slash, and query string stripping options.
When Duplicates Happen
Duplicate content is more common than most site owners realize. The same page is often accessible at: http and https, www and non-www, with and without a trailing slash, with session IDs (?sid=123), with UTM parameters (?utm_source=email), and in printer-friendly variants. Without canonicals, search engines must guess which version to rank.
Canonical vs Hreflang
Canonical tags handle duplicates. Hreflang tags handle language/region variants. They work together. A Spanish translation of an English page should have its own canonical (pointing to itself) plus hreflang tags linking the two language versions. Canonicals consolidate authority; hreflang ensures the right language version appears in the right country's search results.
When to Use This
Use when setting up UTM tracking links that create duplicate URLs, when your CMS generates the same content at multiple URLs, when republishing on another domain, when creating printer-friendly or AMP page variants, or when consolidating thin pages into one authoritative URL during a site restructure.
More Free Tools
CSS Minifier
Minify your CSS to reduce file size and speed up your website in one click.
URL Redirect Checker
Trace where any link goes before you click it and see the final destination URL.
Upside Down Text Generator
Flip text and emojis upside down using Unicode character substitution with a full code point breakdown.
URL Encoder & Decoder
Encode special characters for safe use in URLs, or decode percent-encoded URLs.