Canonical Tag Generator
Generate canonical link tags, Open Graph URL tags, and hreflang tags from any page URL with protocol, www, trailing slash, and lowercase options. Runs entirely in your browser.
What a Canonical Tag Does
A canonical tag is a single line of HTML in the head of a page that tells search engines which URL is the preferred version of that content. The tag looks like this:
<link rel="canonical" href="https://example.com/blog/seo-guide" />
When several URLs show the same or very similar content, such as a page reachable with and without www, with and without a trailing slash, or with tracking parameters attached, the canonical tag consolidates them into one address. Search engines then index, rank, and report the preferred URL, which prevents duplicate content problems and keeps ranking signals on one page.
How to Use the Canonical Tag Generator
- Paste the page URL you want to use as the preferred version.
- Choose how the protocol should be handled: keep the original, force HTTPS, or force HTTP.
- Choose a www preference: keep it, add www, or strip it.
- Toggle trailing slash and lowercase normalization if your site standardizes on them.
- Optionally list language codes to generate matching hreflang alternate tags.
- Copy the canonical, og:url, and hreflang tags into your page head.
The outputs update live as you type or change options, and the tool flags potential issues such as fragments, query parameters, missing protocols, or mixed letter case before you paste anything into production.
When You Need a Canonical Tag
- www versus non-www: if both hosts serve the same pages, pick one as canonical.
- Trailing slash differences: /page and /page/ should point to a single preferred version.
- Tracking parameters: URLs with utm, ref, or session parameters should canonicalize to the clean URL.
- Pagination and filters: category and filter views should typically point to the main category page.
- Syndicated or reprinted content: a copy published elsewhere should point back to the original with a cross-domain canonical.
- HTTP and HTTPS: the secure version is the standard choice unless the site is HTTP-only.
Choosing the Canonical URL
Consistency matters more than the specific choice. Decide once whether your site uses https or http, www or no www, trailing slashes or none, and lowercase paths or mixed case. Then apply that rule everywhere: internal links, sitemaps, redirects, and canonical tags. If your canonical points to a URL variant that then redirects, you are wasting crawl budget and creating ambiguity, so make sure the canonical URL returns a 200 status directly.
A canonical tag is a hint, not a directive. Google treats it as a strong suggestion and may choose a different canonical if the signals conflict. The strongest setup combines self-referencing canonical tags on every page with consistent internal links and server-side redirects that funnel duplicate variants to the preferred URL.
Canonical Tags and Hreflang
Multilingual and multi-regional sites use hreflang tags to tell search engines which language or regional version to show. Each hreflang alternate should point to the canonical, indexable URL of that version, and every page should include a self-referencing hreflang entry for its own language. If you only need the alternate link tags without the canonical options, the Hreflang Tag Generator focuses on that task.
Canonical tags also pair with other head tags. The Meta Tag Generator builds titles, descriptions, Open Graph, and Twitter Card tags, and the generated og:url tag from this tool should match the canonical exactly.
Common Canonical Mistakes
- Pointing the canonical at a URL that redirects or returns a 404.
- Using absolute URLs with the wrong protocol or a missing domain.
- Adding fragments such as #section to a canonical href. Fragments identify positions within a page, not separate pages.
- Canonicalizing every page to the homepage. That removes the rest of the site from the index.
- Blocking a canonical URL in robots.txt while expecting it to be indexed.
- Mixing www and non-www in internal links, which sends conflicting signals.
Your URLs Stay Private
This tool runs entirely in your browser. The URLs you paste are never sent to a server, logged, or stored. That makes it safe to test internal staging URLs, unpublished page paths, and anything else you would rather not reveal while you work on technical SEO.
Frequently Asked Questions
Is a canonical tag the same as a redirect?
No. A redirect sends visitors and crawlers to a new URL and is the strongest way to consolidate duplicates. A canonical tag leaves the page accessible but suggests which URL should be indexed. Use redirects for users and canonical tags as a backup signal for URL variants that must remain reachable.
Should every page have a self-referencing canonical?
Yes, in most cases. A page that canonicalizes to itself confirms the preferred URL and protects against duplicate versions created by parameters or alternate paths. It is one of the simplest technical SEO wins.
Can I use a canonical tag across different domains?
Yes. Cross-domain canonicals are common for syndicated content. The canonical href can point to a URL on another domain, as long as the other page is the true original and is publicly accessible.
Do query parameters belong in a canonical URL?
Only if they change the page content meaningfully, such as a product variant or a paginated listing. Tracking parameters like utm_source should be excluded so the clean URL is indexed. The tool flags query strings so you can decide deliberately.
What happens if I set the wrong canonical URL?
A wrong canonical can drop the intended page from search results or consolidate its signals into another URL. Audit canonicals after migrations and use a crawler to verify that every canonical target returns a 200 status and is indexable.
Does the canonical tag affect users in any way?
No. Canonical tags only affect search engine indexing. Visitors always see the URL they requested. If you want browsers and users moved to the preferred URL, add a server-side redirect, which you can plan with the 301 Redirect Code Generator.
How many canonical tags can a page have?
Exactly one per page. Multiple canonical tags create conflicting instructions and search engines may ignore all of them. If you also use hreflang alternates, those are separate link elements and are not canonical tags.