Canonical Tag Generator

Turn an absolute HTTP or HTTPS URL into a rel=canonical link tag. Review the target before adding it to a page head.

Create a snippet for the preferred URL you have already selected. The generator removes a URL fragment and HTML-escapes the resulting attribute.

  • 100% free
  • No registration
  • On your device
  • Modern browser
  1. 1Enter details
  2. 2Adjust options
  3. 3View result

https://example.com/page

Your input stays on this device for this operation. We don’t upload or store it.

About Canonical Tag Generator

Create a snippet for the preferred URL you have already selected. The generator removes a URL fragment and HTML-escapes the resulting attribute.

URL normalization

Parse a complete HTTP or HTTPS URL and drop its fragment.

HTML escaping

Escape the href before generating the link tag.

How to use Canonical Tag Generator

  1. 1

    Enter the preferred URL

    Enter the preferred absolute Page URL

  2. 2

    Generate the canonical tag

    Press Generate and inspect the target

  3. 3

    Add the tag to the head

    Copy the link tag into the page’s HTML head

Formats and practical limits

Absolute URL → one HTML canonical link tag

  • Queries are retained. Remove tracking parameters yourself when they should be absent from the canonical target.
  • The generator does not crawl the site or choose a canonical for you. Search engines can select a different canonical.

Practical example

Enter https://example.com/guide#intro to generate a canonical pointing to https://example.com/guide.

Further reading

Frequently Asked Questions

1 answers
Does it redirect visitors?

The tag supplies a canonical signal. A redirect requires separate server or application configuration.