Build canonical URL

Create an absolute rel=canonical URL and link element for a page.

freeworks offlinenothing uploaded
ToolCanonical URL Builder
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Scheme, host, path, query, fragment, and trailing-slash policy are normalized, then an absolute canonical link or header value is emitted. Fragments are removed because they identify locations within a document.

  • Absolute HTTPS URLs make signals unambiguous.
  • Query handling remains explicit because parameters can change content.

Worked example

Blog article canonical URL tag
Generate a canonical link tag for a blog article URL
Input
											URL: https://example.com/blog/my-article
Include link: true
Include header: false
										
Output
												<!-- Canonical URL -->
<link rel="canonical" href="https://example.com/blog/my-article">
											

When to use this

CMS templates, faceted pages, and SEO audits build canonical signals.

Edge cases

  • A canonical pointing to a redirect weakens the signal.
  • Dropping a content-bearing query merges different pages.
  • Cross-language canonicals need hreflang coordination.

References