---
title: Free Canonical Tag Generator
slug: canonical-tag-generator
last_reviewed: 2026-06-30
author: editorial
source: LemAudit Free Tools
---

## Intro

The canonical tag is one of those small pieces of HTML that quietly decides whether your site ranks or gets clobbered by duplicate-content collapse. When Google's crawler sees the same content reachable at multiple URLs — `?utm_source=x`, `/index.html` vs `/`, `www` vs apex, HTTP vs HTTPS, paginated archives, faceted product listings — it has to choose one URL to keep in the index. The canonical tag is how you tell it which.

This generator outputs the three pieces Google's crawler actually checks for consistency on a canonical page:

1. **The `<link rel="canonical">` tag** — the primary signal. Lives in the `<head>`. Absolute URL, https, no fragment.
2. **The `<meta property="og:url">` tag** — the Open Graph equivalent. Used by Facebook, LinkedIn, Slack, and increasingly by search engines as a corroborating signal.
3. **The JSON-LD `mainEntityOfPage` reference** — the structured-data version. Tells crawlers that the `WebPage` schema applies to *this* URL, not the variant they crawled.

All three need to agree. If your `<link rel="canonical">` says `https://example.com/blog/post` but your `og:url` says `https://example.com/blog/post?utm_source=newsletter`, you've handed Google an ambiguous signal and it gets to pick. Often it picks the wrong one. This generator keeps them in sync automatically.

The tool runs entirely in your browser — paste your URL, get three pre-formatted snippets, copy them into your page template. No signup, no log, no network call.

## When not to use this

Don't use a self-referencing canonical to "fix" duplicate content that should be handled at the routing layer. If `www.example.com` and `example.com` are both serving the same pages with different canonicals, the real fix is a 301 redirect from one to the other, not a canonical tag. Canonicals are a hint to Google; redirects are a directive. Use redirects when you can.

Don't canonicalize across languages or substantially different content. A canonical tag tells Google "this is the same page, prefer this URL". If you're pointing your German page at your English page, you're telling Google your German content is a duplicate of your English content — and Google will drop it from the index. Use `hreflang` for that case instead; we have a [hreflang generator](/tools/hreflang-generator) for that.

Don't canonicalize a paginated series to page 1. That was a 2014 best practice that Google publicly retired. Today, each page in the series should canonicalize to itself, and you should use `rel="next"` / `rel="prev"` (or just let Google figure it out).

## FAQ

### Can I have multiple canonical tags on one page?

No. Google treats that as a conflict and may ignore both. One `<link rel="canonical">` per page, in the `<head>`, before any script that might inject another one.

### What's the difference between a canonical tag and a 301 redirect?

A canonical tag is a hint — Google can ignore it if other signals strongly suggest a different canonical. A 301 redirect is a directive — the user (and Googlebot) never see the alternate URL because the server forces them to the destination. Use a redirect when you can; use a canonical when the duplicate URL needs to keep working (e.g. tracking parameters).

### Should the canonical URL include query strings?

Generally no — strip tracking parameters, sort parameters, anything not required to render the page. The exception is when the query string genuinely changes the page content (e.g. `?product_id=42` on a product page). In that case the canonical should include it.

### Why include the JSON-LD snippet?

Because Google's structured-data parser uses `mainEntityOfPage` to disambiguate which page the schema describes. If you have `Article` schema with `mainEntityOfPage` pointing at the canonical URL, you've added a second corroborating signal that this is the version Google should index.

### Does this generator validate the URL?

Yes — it checks that the URL is absolute, prefers HTTPS, and warns if there's a fragment (`#`) that Google will ignore. It doesn't verify the URL is reachable; that's a job for the [CMS detector tool](/tools/detect-cms).

### Does this work for AMP pages?

For AMP, the canonical tag on the AMP page should point at the non-AMP version (and the non-AMP page should declare the AMP version via `<link rel="amphtml">`). The snippet from this generator is correct for both directions — just paste the right URL.
