Canonical URL Generator
Generate a canonical <link> tag for any URL.
Loading…
About Canonical URL Generator
Pages that can be reached under several addresses, such as with tracking parameters or a trailing slash, leave search engines to guess which one is the main version. Enter the preferred URL and the tool writes a single link tag that names it. It lowercases the scheme and host, encodes spaces and non-ASCII characters, strips any #fragment and refuses localhost or private addresses. The tag is a hint to search engines, not a redirect, so visitors stay on the page they opened.
Features
- Writes one rel=canonical link tag
- Lowercases the scheme and host and encodes spaces and non-ASCII characters
- Strips the #fragment and tells you it did
- Rejects localhost, private network and non-http addresses
- Escapes ampersands in query strings so the tag stays valid HTML
Limitations
- It writes the tag only. It does not check that the target page exists, returns a success status or matches the page you are tagging.
- Query strings and trailing slashes stay as you typed them, so decide on the preferred form before you enter it; a bare domain always gets a trailing slash.
- One address at a time; there is no bulk mode.
- Downloading canonical.html needs a free account; copying the tag does not.
How it works
- Type or paste the full address of the preferred version of the page, starting with http:// or https://.
- Read any message under the field: it flags an unusable address, or tells you that a #fragment was removed.
- Check the link tag in the output box.
- Copy it, or download it as canonical.html.
- Paste the tag into the head of the page, and repeat it on every duplicate variant that should point to this URL.
Example input
<link rel="canonical" href="https://example.com/preferred-page">Frequently asked questions
- A canonical tag is a hint in the page's head that names the preferred URL, and visitors still see the page they opened. A redirect, such as a 301, sends browsers and crawlers to another address. Use a redirect when the old URL should stop being used, and verify it with the redirect checker.
- A fragment only points to a spot inside a page and is never sent to the server, so a canonical URL should not carry one. The tool strips it and shows a note under the field. The query string is kept, because it can change what the page shows.
- Often, yes: a self-referencing canonical on the preferred page is common. Enter that page's own address to produce it. On a duplicate, enter the preferred page's address instead. The tool cannot tell which page you are tagging, so the choice is yours.
- The root path of a URL is always written with a slash, so https://example.com becomes https://example.com/. Both reach the same page, but the tag shows the normalized form. Paths below the root keep exactly what you typed.
- No. Nothing is fetched. The tag is built in your browser from the one address you enter, so it cannot see whether your page already has a canonical tag. To read what a live page declares, run it through the website SEO checker.
Related tools
- Meta Tag GeneratorGenerate HTML meta tags, Open Graph and Twitter/X Card tags.
- Redirect CheckerTrace redirect chains for any URL.
- Website SEO CheckerFree SEO audit tool — analyze any website's technical and on-page SEO.
- Robots.txt GeneratorGenerate a robots.txt file with a form-based builder.
- XML Sitemap GeneratorGenerate an XML sitemap from a list of URLs.
