Canonical URL Generator
Turn any address into one clean canonical URL — without tracking parameters, with the protocol, host name and trailing slash you choose — and copy the tag, header or sitemap entry for it.
- Tag + HTTP header
- Strips tracking
- Up to 5,000 URLs
- Runs in your browser
Result
Enter a page URL to get its canonical form and the ready-to-paste code.
Paste this tag into the <head> of the page and of every duplicate version of it.
For files that cannot contain a tag, such as PDFs: send the canonical in a Link response header. In the server snippets, change the file name to the file that should point to this URL.
Response header
Apache (.htaccess)
nginx
Use the same address for Open Graph so that shares and likes are counted for one URL.
List only canonical URLs in your XML sitemap. The address is XML-escaped.
What changed
Findings
Result
Paste a list of URLs to normalize them all at once and find duplicates.
- URLs
- 0
- Changed
- 0
- Duplicates
- 0
- Invalid
- 0
| # | Original | Canonical | Status |
|---|
No rows with this status.
Normalization rules
A trailing slash is never added to file-like paths such as /guide.html, and the root path always stays /. Pick the variant your server actually answers with a 200 status.
Separate names with commas or spaces. Names are not case-sensitive and * matches any text, for example utm_*.
The scheme and host name are always lowercased, as the URL standard requires. International domain names are shown the way people read them but written in punycode (xn--…) in the code, because that is the form browsers and crawlers request.
Check the canonical tag of an existing page
Paste the <head> (or the whole source) of a page. The HTML is only read in your browser and is never added to this page or sent anywhere.
How to generate a canonical tag
The result updates while you type.
- 1
Enter the page URL
Paste one address, or switch to the bulk list and paste up to 5,000 addresses, one per line.
- 2
Set the normalization rules
Choose https, www or non-www, the trailing slash and which query parameters stay. “What changed” lists every step that was applied.
- 3
Copy the code
Take the HTML tag, the HTTP header, the og:url tag or the sitemap entry. In bulk mode, export the list as CSV, link tags or sitemap.xml.
From messy address to one canonical URL
Normalization follows RFC 3986 and the URL standard.
Four outputs
The <code><link rel="canonical"></code> tag, a <code>Link</code> response header with Apache and Nginx snippets, the matching og:url tag and an XML sitemap entry.
Query parameter control
Keep all parameters, remove tracking parameters from an editable list, keep only your allow-list or remove them all. Parameters can also be sorted and empty ones dropped.
Protocol, host and slash
Force https, add or remove www and the trailing slash. File-like paths such as <code>/guide.html</code> never get a slash, and index file names can be removed.
Tidy encoding
Removes default ports, fragments and duplicate slashes, resolves <code>.</code> and <code>..</code> segments, repairs percent-encoding and writes international domain names in punycode.
Bulk mode with duplicates
Normalizes a whole list, marks each row as changed, unchanged, invalid or duplicate of an earlier row, and filters by status.
Checker for existing pages
Paste the source of a page to find missing, repeated or conflicting canonical tags, a tag outside the head, a clash with noindex or a different og:url.
Private by design
Everything runs in your browser. What you type, paste or open is not sent to a server.
Free, no sign-up
No account, no limits, no watermark — on a phone, tablet or computer.
What a canonical URL is and when you need one
The same page is often reachable under several addresses: with and without www, over http and https, with a trailing slash, with ?utm_source=… or a sort parameter attached. Search engines treat each address as a separate URL and have to choose one to show. The canonical URL is the version you prefer. You declare it with <link rel="canonical" href="…"> in the <head> of every variant, so that links and other signals are combined on one address.
The tag is a strong hint, not a command. Search engines also look at redirects, internal links and the sitemap, and they may pick another address when these disagree. So link internally to the canonical version, list only canonical URLs in the sitemap and redirect the obvious variants, such as http to https, with a 301. A page without duplicates should carry a self-referencing canonical. For files that have no head, such as PDFs, Google also accepts the canonical in a Link HTTP header.
Typical mistakes: a relative or protocol-less address instead of an absolute one; a canonical that points to a redirect, an error page or a page blocked in robots.txt; two different canonical tags on one page, which can make search engines ignore both; a canonical together with noindex, which sends conflicting signals; and pointing every page of a paginated series to page one, which hides the later pages. A canonical must also lead to equivalent content — it is not a substitute for a redirect to a different page.
Ways to declare the canonical URL
| Method | Where it goes | Best for |
|---|---|---|
| <code><link rel="canonical"></code> | In the <code><head></code> of the HTML page | All normal web pages |
| <code>Link</code> HTTP header | In the server response | PDFs and other files without a head |
| XML sitemap | In sitemap.xml | A weaker supporting signal for the whole site |
| 301 redirect | In the server configuration | Variants that visitors should never see |
Tips
- List only canonical addresses in your sitemap — build it with the Sitemap Generator.
- Make sure the other variants really redirect to the canonical address with the Redirect Checker.
- Write the http → https and www redirects with the .htaccess Generator, and the remaining head tags with the Meta Tag Generator.
- Use the same address in the canonical tag, in og:url, in internal links and in the sitemap. Mixed signals are the main reason a search engine chooses a different canonical.
Frequently asked questions
Can’t find your answer? Contact us — we reply quickly.
Where does the canonical tag go?
Inside the <head> of the page, once. A canonical tag in the body is ignored. It should be present in the HTML the server delivers, not only added later by JavaScript.
Should a canonical URL be absolute or relative?
Absolute: with https:// and the host name. Relative addresses are allowed, but they break easily — for example when the page is also reachable on a test domain or over http.
Does every page need a canonical tag?
It is not required, but a self-referencing canonical on every indexable page is good practice. It protects the page against duplicates created by tracking parameters and other address variants.
What is the difference between a canonical tag and a 301 redirect?
A redirect sends visitors and crawlers to another address; the old one can no longer be opened. A canonical leaves every variant reachable and only tells search engines which one to index. Use a redirect when nobody needs the old address.
Why does Google choose a different canonical than mine?
Because the tag is only one signal. If internal links, the sitemap or redirects point to another variant, or the pages differ noticeably, Google may decide differently. Make all signals name the same address.
Is my data sent to a server?
No. The tool runs entirely in your browser. Your input is not uploaded, logged or stored on our servers.
More free SEO and website tools
Generate tags and files, check status codes, redirects, DNS and certificates — free, without an account.