Canonical Tag Generator
Paste a page URL, choose whether to switch it to https, drop www, and add or strip a trailing slash, and get a <link rel="canonical"> tag to paste into the <head>.
You can omit https://. If there is no protocol, the tool parses the address as https.
Nothing to generate yet
Enter a page URL to get its canonical tag.
How it works
A canonical tag is a <link rel="canonical"> line in the page's <head>. It names a preferred URL when more than one address could show the same content, for example http versus https, with or without www, or with or without a trailing slash. The tag does not redirect visitors; anyone who opens a URL stays on it. Search engines can use the tag as a signal for the preferred address, but they do not have to follow it.
Paste the page URL. If it has no protocol, the tool parses it as https. By default the tool switches the protocol to https:// (you can turn that off), leaves www in place if it is there, and leaves the trailing slash as you pasted it. You can turn on "Strip www.", and choose "Add trailing slash" or "Strip trailing slash". A slash on the root URL itself, such as https://www.example.com/, is not removed.
The tool does not delete query parameters or a # fragment. If you do not want them in the tag, delete them from the field before you copy. The URL is normalized the way a standard URL parser does it: the host is lowercased, and non-ASCII characters are percent-encoded. If the URL contains &, it becomes & in the href value so the HTML stays valid. The tool only builds the tag; it does not update your site.
How to use it
- Paste the page URL in the "Page URL" field. You can omit https://.
- Choose how to handle a trailing slash: "Keep as-is", "Add trailing slash", or "Strip trailing slash".
- Turn on "Force https://" if you want (it is on by default) and "Strip www." if you need that.
- Copy the tag on the right and paste it into the page's <head>. The normalized URL is shown under the tag.
Examples
Frequently asked
- Does a canonical tag redirect visitors?
- No. It is only a mark in the <head>. Anyone who opens a URL stays on it. To send visitors to a different address, use an HTTP redirect.
- Does every page need a canonical tag, even with no duplicates?
- It is not required. You can point the tag at the same URL as the page, to state the preferred address explicitly. This tool does not check your site for duplicates.
- What happens to www and http by default?
- http is switched to https, and www is kept. Turn on "Strip www." to remove it. If you paste a URL with no protocol, the tool still parses it as https even when force https is off; to get http, type http:// explicitly and turn the toggle off.
- Should I keep or remove the trailing slash?
- The tool does not choose a convention for your site. Pick one form and use it in the tag, in internal links, and in the sitemap. "Strip trailing slash" does not remove the slash from the root URL itself, for example https://www.example.com/.
- Why are query parameters still in the tag?
- The tool does not strip the query string or a # fragment. If you want a tag without tracking parameters, delete them from the URL in the field, then copy.
- Where do I paste the tag?
- In the page's <head>. On a site with a theme or an SEO plugin there is sometimes a separate field for the canonical URL; in that case enter the normalized address, not the HTML line.