Canonical

Canonical Tag Generator

Enter the preferred URL for a page, optionally add its language versions, and get correct, escaped <link> tags to paste into the page head. No website is fetched or checked.

Back

1. URLs

Local

hreflang alternates (optional)

Add a row for each language or regional version, e.g. en-gb → its URL.

2. HTML for the <head>

Escaped
Enter the canonical URL to generate the tag.

Preview

The preview appears once the URLs are valid.

Place the generated tags inside the <head> of the matching page. Search engines treat canonical tags as a hint and may choose a different URL.

About this tool

About Canonical Tag Generator

Canonical Tag Generator creates a correctly escaped <link rel="canonical"> tag for the preferred URL of a page, and optionally the hreflang alternate tags for its language versions and an x-default link. A preview shows exactly which URLs the tags point to.

When the same content is reachable at several URLs — with tracking parameters, trailing slashes or printer-friendly versions — a canonical tag tells search engines which one you prefer. Generating it avoids typos and unescaped characters that would make the tag unreliable.

How to use

Step by step

  1. Enter the full canonical URL of the page.
  2. Optionally add a page title to label the preview.
  3. Add hreflang alternates for other language or regional versions if you have them.
  4. Tick x-default and enter its URL if you use a fallback page.
  5. Review the code and the preview.
  6. Copy the code or download it, and paste it into the page's <head>.
Key features

What it offers

  • Validates absolute http:// and https:// URLs
  • Optional hreflang alternates with language-code checks
  • Optional x-default alternate
  • HTML-escaped attribute values
  • Visual preview of the canonical and alternate URLs
  • Copy code or download as .html
Best practices

Tips for best results

  • Use the exact, final URL you want indexed, including https:// and the preferred host.
  • Add the tag to the <head> only, and use one canonical tag per page.
  • Point the canonical at a page that returns 200 and is not blocked by robots.txt.
  • With hreflang, list every language version on every version, including itself.
  • Keep canonical tags, internal links and sitemaps consistent with each other.
Benefits

Why people use it

Clear preference

Signals which URL you want treated as the main version.

Correct markup

Escaped, well-formed tags every time.

Multilingual ready

Generate hreflang alternates in the same step.

Private

Generated in your browser — no page is fetched.

FAQ

Common questions

It is a <link rel="canonical"> tag that tells search engines which URL you prefer when the same or very similar content is available at several URLs.
Inside the <head> section of the page it refers to. Put the matching tags on each page; a canonical tag in the <body> is ignored.
No. A canonical tag is a strong hint, not a directive. Search engines can choose a different canonical URL if other signals disagree.
Yes. The tool requires a full http:// or https:// URL, which avoids mistakes caused by relative paths.
Links that point to the versions of the same page in other languages or regions, such as en-gb or es. Each version should list all versions, including itself.
An optional hreflang value for the page to show when no language version matches the visitor, such as a language selector or a global page.
No. It does not fetch any website or detect existing tags; it only generates the code from what you enter.
Private by design

This runs entirely in your browser

No file or text you enter here is uploaded. Encoding and decoding happen on your device using native browser APIs — close the tab and nothing remains on a server.

Install Toolisco Add it to your device for offline, one-tap access.