Canonical URL Generator

Generate a canonical link tag.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste a page address and press Generate. You get a cleaned version with https added if missing, the host in lowercase, and every query parameter and fragment removed.

How to use

1
Step 1
Paste the page URL into the input.
2
Step 2
Press Generate.
3
Step 3
Use the result as the href of your rel=canonical link tag.

How it works

The URL is parsed, the query string and fragment are cleared, and the rest is rewritten, so Example.com becomes example.com and a bare domain gets a trailing slash. The path keeps its capitalisation. Because every parameter is dropped, do not use it for pages whose content depends on a parameter such as ?id=2.

Worked example

A tracked URL

Input
example.com/page?utm_source=x&id=2#top
Output
https://example.com/page
Walkthrough
https:// is added, the query string with both parameters and the #top fragment are removed.

Limitations

  • Removes all query parameters, including ones that identify content.
  • Returns the address only, not the full link tag.
  • Does not check what the page canonical should be.

Questions

What is a canonical URL?
The preferred address of a page, declared with a rel=canonical link, so duplicates point to one version.
Does it keep ?page=2 or ?id=5?
No. All query parameters are removed.
Does it give me the link tag?
No. Wrap the result yourself: <link rel="canonical" href="...">.

Features

  • Adds https if missing
  • Strips query and fragment
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Intro to Google Search Console

    Google Search Central

    Official GSC intro next to SEO preview and audit helpers.

    Watch on YouTube
  • How to avoid duplicate content

    Google Search Central

    Canonical and uniqueness issues meta tools help you catch.

    Watch on YouTube