A canonical tag generator rejects any URL that is not a complete, credential-free HTTP or HTTPS address, so the most common mistakes at the input stage are simply the wrong shape of URL. The generator will not produce a link element for relative paths such as `/products/widget`, for unsafe schemes such as `javascript:` or `data:`, or for URLs that embed a username and password — those inputs return nothing and the page keeps its old, possibly missing, canonical signal. When the input passes those checks, the browser URL parser also normalizes the address behind the scene: the host becomes lowercase, the default port disappears, and an internationalized host converts to its ASCII-compatible form. Fragments such as `#details` are dropped because Google documentation generally treats fragments as in-resource pointers rather than separate canonical targets. Recognizing these rejections and silent normalizations lets you fix the input before copying the tag and avoids publishing an element that quietly points to the wrong page.

Inputs the generator rejects before producing a tag
A canonical tag is only useful when search engines can fetch the URL it points to, so the generator enforces three input rules before it outputs anything.
Relative paths are rejected because their meaning depends on the document that reads them. If you paste `/products/widget`, the resulting canonical would only be valid in pages whose host happens to match the one you had in mind; deploy the site under a different root or test it on a staging host and the same tag silently points elsewhere. Always paste the full address including the scheme and host, such as `https://example.com/products/widget`.
Unsafe schemes are rejected. FTP, `javascript:`, `data:`, and other non-HTTP schemes do not identify a publicly crawlable resource in the same way, so the tool returns nothing rather than producing a tag that looks valid but resolves to the wrong thing.
Credentials are rejected. A URL like `https://user:[email protected]/private` is refused because a canonical element is a public markup signal — putting a username or password into the href exposes that information in every page that ships the tag. If the page needs authentication, canonicalization does not make it public; revisit whether the page should be indexed at all before generating a tag for it.
If the input fails any of these checks, the generator returns nothing rather than producing a guessed output. That conservative behavior is the first line of defense against the most expensive mistake: a published tag with a quietly wrong href.
The table below summarizes what is accepted, what is normalized, and what is refused before the generator ever writes an element.
| Input shape | Example | Result |
|---|---|---|
| Absolute HTTP/HTTPS | https://example.com/page | Tag generated |
| Relative path | /products/widget | Rejected |
| HTTPS with default port | https://example.com:443/page | Port dropped, tag generated |
| HTTPS with fragment | https://example.com/page#details | Fragment stripped, tag generated |
| Unicode host | https://例え.jp/path | Host converted to Punycode, tag generated |
| Credentialed URL | https://user:[email protected]/page | Rejected |
| javascript: scheme | javascript:alert(1) | Rejected |
What the browser parser changes silently
Even when the URL passes the input checks, the browser's URL implementation applies several normalizations before the generator wraps the href in a `link rel="canonical"` element. These are not errors — they are part of the WHATWG URL Standard — but they change the address, and you have to know they happened.
Host case is normalized to lowercase. An uppercase host like `https://Example.COM/Page` becomes `https://example.com/Page`. Path case is preserved: `/Page` stays `/Page`, and the server may serve a different resource at `/page`. If the site distinguishes paths by case, the tag you generate may not match the live URL.
Default ports are removed. Port 443 disappears from HTTPS addresses, and port 80 disappears from HTTP addresses. A custom port such as `:8080` is preserved because it is part of the address.
Internationalized domains are converted to their ASCII-compatible form using IDNA processing. A Unicode host such as `https://例え.jp/path` is normalized to its Punycode form before it appears in the href, and non-ASCII paths are percent-encoded so the attribute remains valid HTML.
Fragments are removed. A `#details` at the end of the address is stripped because, according to Google's canonical guidance, search systems generally do not support fragment URLs as canonical targets, and a fragment identifies a position inside a representation rather than a separate network resource.
Query strings are preserved. Tracking parameters, sort keys, and other intentional query strings survive normalization because they may be part of the deliberately chosen canonical address — the generator does not decide that for you, and neither does the parser.
Generate a canonical tag with the Canonical Tag Generator
Once the input shape and the silent normalizations are clear, the actual run is short.
- Open the Canonical Tag Generator in any modern browser. The input stays local to the page and is not sent to a server.
- Paste the complete preferred URL, including the scheme (http or https) and the host. Add any intentional path and query string, but leave the fragment off.
- Click generate. The tool parses the URL, strips any fragment, normalizes the host and default port, and produces a single HTML element of the form `` with ampersands escaped as `&`.
- Compare the normalized URL shown next to the tag with the live 200 response you want search engines to prefer. Confirm the host, path case, and query string match the address that actually serves the canonical content.
- Copy the element into the HTML `` of the chosen page, never the ``. Inspect the delivered page and confirm exactly one canonical element is present and points to the intended 200 response.
For a worked example that walks the same path from URL to head tag on a real page shape, see the Canonical Tag Generator example from URL to head tag walkthrough.
Mistakes to catch after pasting the tag into the head
A generated tag can still be wrong even when it copied cleanly. The most common post-publish mistakes fall into a few patterns.
Conflicting canonical signals. The same page can carry a canonical in the HTML head, a different canonical in an `X-Robots-Tag` or `Link` HTTP header, and a third address in the sitemap. Search systems combine all of these, and inconsistencies weaken the signal. After adding the generated element, audit the response headers and the sitemap entry for the same URL.
Wrong scheme or host. A site that has migrated to HTTPS may still serve the canonical from HTTP, or a staging environment may emit the production URL with a different host. View the rendered HTML on the real URL — not the editor preview — before declaring the tag correct.
Self-reference missing. The preferred page should usually carry a self-referential canonical, and duplicate versions should all point to the same address. A page that points to a different canonical than the version it duplicates sends a contradictory signal, and search systems may pick either one.
Authentication assumed public. Canonicalizing an authenticated URL does not make it public. If the page sits behind login, the canonical does not bypass access control; decide whether the page should be indexed before publishing the tag.
Keeping one canonical signal across HTML, headers, and sitemaps
Consistency is what makes a canonical signal strong. The generator produces only markup, so the rest of the signal has to be aligned manually.
Treat the canonical target as a contract: every duplicate that links to the preferred page should point to the exact same href, including scheme, host, path case, and query string. After publishing, crawl a representative set of routes — not just one — and confirm each one shows exactly one canonical element whose address is the intended 200 response.
Sitemaps and HTTP headers should agree with the HTML canonical. If the sitemap lists `https://example.com/page/` and the canonical element points to `https://example.com/page` (with or without trailing slash), search systems have to choose between two valid-looking signals and may pick unpredictably.
Canonical tags do not redirect users, do not remove a URL from search immediately, and do not replace a migration redirect. Use permanent redirects when a duplicate should no longer be served, and keep important internal links pointed at the same preferred address. The tag consolidates signals; the redirect moves users and crawlers.
Related reading: Generate Hreflang Tags Without Mistakes: A Row-Level Workflow.