SEOAnalytics Lab

Canonical Tag Generator

Free online canonical tag generator. Enter a page URL, clean it up and copy a ready-to-use rel canonical tag. No signup.

Clean-up options
Canonical tag (HTML)
Your canonical tag will appear here.
HTTP header (for PDFs and other files)
The header version will appear here.

Paste the tag inside the <head> section of the page. Use one canonical tag per page and point it to the version of the page you want search engines to index.

What is a canonical tag?

A canonical tag is a short line of HTML that sits in the head section of a web page. It tells search engines which web address is the main, preferred version of that page. Many websites can reach the same content through more than one URL, and without guidance a search engine has to guess which one to show in the results.

That guess can split your ranking signals across several addresses, so none of them performs as well as it could. A canonical tag removes the guesswork by pointing every duplicate address to a single URL. Our canonical tag generator cleans up your URL and builds the tag for you, so you can copy it straight into your page.

Why duplicate URLs happen

  • Tracking parameters: Links shared in newsletters, ads and social posts often end with utm_source, fbclid or gclid. Each version is a new address for exactly the same page.
  • http and https: If both versions of your site load, search engines can see two copies of every page on it.
  • www and non-www: The same page can open with or without www at the start of the domain name.
  • Trailing slashes: A page may answer to both /pricing and /pricing/, which are technically two different URLs.
  • Filters and sorting: Online shops create many addresses for one category by adding sort, color or price options to the link.
  • Syndicated content: An article republished on another website creates a copy that you may want to credit to the original page.

Step-by-step: creating your canonical tag

  • Enter the page URL: Paste the full address of the page you want search engines to treat as the main version. If you leave out https, the tool adds it for you.
  • Pick your clean-up options: Force HTTPS, remove www, remove the trailing slash, strip tracking parameters, remove all query parameters or drop the fragment after the hash sign.
  • Copy the HTML tag: The generated tag updates as you type. Press Copy and paste it into the head section of the page.
  • Use the HTTP header for files: PDFs and images cannot hold an HTML tag. For these, copy the Link header version and ask your developer to send it from the server.
  • Check the result: Open the page, view the source and confirm there is exactly one canonical tag with the address you expect.

Which clean-up options should you choose?

The right settings depend on how your site works. Forcing HTTPS is almost always correct today, because browsers and search engines prefer secure pages. Removing www or keeping it is a matter of choice, but you must pick one and use it everywhere, including your sitemap and internal links.

Removing tracking parameters is safe because they never change the content of a page. Be careful with the option that removes all query parameters. Some sites use parameters to load different content, such as a product number or a page number. If the content changes with the parameter, the address with the parameter may need its own canonical tag.

For the trailing slash, follow what your server already does. If your pages normally end with a slash, keep it, and if they do not, remove it. The tool keeps the slash on a homepage because the root address always needs one.

Canonical tag best practices

  • Use absolute URLs: Write the full address, including https and the domain, instead of a relative path. It avoids mistakes.
  • One tag per page: Several canonical tags on one page can lead search engines to ignore all of them.
  • Put it in the head: A canonical tag placed in the body of the page is not valid and will usually be ignored.
  • Point to a working page: The canonical address should return a normal page, be open to indexing and not redirect somewhere else.
  • Avoid canonical chains: Page A should not point to page B if page B points to page C. Send every duplicate straight to the final address.
  • Do not mix with noindex: A noindex tag and a canonical tag to a different page send conflicting signals. Choose one.
  • Use a self-referencing canonical: Even a page with no duplicates benefits from pointing to itself, because it protects against parameters added later.

Common canonical tag mistakes

  • Pointing everything to the homepage: Some sites set every page canonical to the home page. Search engines then treat all those pages as copies of the homepage and may drop them from the results.
  • Canonicalizing paginated pages to page one: Page two of a list usually has different content from page one, so it should have its own canonical.
  • Blocking the canonical page: If the canonical address is blocked in robots.txt, search engines cannot read it.
  • Using a canonical instead of a redirect: When an old page is gone for good, a 301 redirect is the stronger choice.
  • Forgetting the sitemap: List only the canonical addresses in your XML sitemap so every signal agrees.

Canonical tag or 301 redirect?

A redirect sends every visitor to a new address, while a canonical tag only suggests the preferred address to search engines. Visitors stay on the page they opened. Use a redirect when the old address should disappear, for example after moving to HTTPS. Use a canonical tag when several addresses must keep working, such as a shared link with tracking parameters.

Keep in mind that a canonical tag is a strong hint, not a command. Search engines may choose a different address if other signals, such as redirects and internal links, point somewhere else.

How to check that your canonical tag works

After adding the tag, open the page, right-click and choose view page source, then search for canonical. You should see one tag with the address you chose. For a deeper check, use the URL Inspection tool in Google Search Console. It shows the canonical address you declared and the one Google actually selected.

If they differ, look for conflicting redirects, internal links or sitemap entries. Changes can take a few days or weeks to show, so check again before making more edits.

How to use Canonical Tag Generator

  1. Enter the URL of the page.
  2. Choose the clean-up options you need.
  3. Copy the canonical tag.
  4. Paste it inside the head section of the page.

Frequently Asked Questions

What does rel canonical do?

It tells search engines which URL is the preferred version of a page, so ranking signals are not split between duplicate addresses.

Should every page have a canonical tag?

It is good practice. A self-referencing canonical on each page helps avoid problems with tracking parameters and duplicate versions.

Is a canonical tag the same as a redirect?

No. A redirect sends visitors to another page, while a canonical tag only suggests the preferred URL to search engines and visitors stay on the page.

Can I use a canonical tag for a PDF?

Yes. A PDF cannot hold an HTML tag, so use the HTTP header version, which your server sends along with the file.

Related Tools