Canonical URL Comparator
Compare two URLs across scheme, host, path, query, and fragment.
Result
How to use Canonical URL Comparator
- Enter the values in the order shown in the input label or try the built-in sample.
- Select Run tool to generate the output.
- Review the output before copying it.
How it works
Compare two URLs across scheme, host, path, query, and fragment. Parse both URLs and compare the named components.
Formula or processing rules
Parse both URLs and compare the named components.
Worked example
The sample compares a page URL with a referral query against its clean canonical. The query is flagged as the difference.
| Measure | Value |
|---|---|
| Page URL on line 1; canonical URL on line 2 | https://example.com/a?ref=1 https://example.com/a |
| Result | protocol: same hostname: same port: same pathname: same search: ?ref=1 → (empty) hash: same |
Before using the result
Compare the scheme, host, path, query, and fragment separately. A tracking-query difference may be intentional. A difference between two unrelated paths deserves a content and URL review.
Pros and cons
Pros
Compare two URLs across scheme, host, path, query, and fragment. The sample provides an immediate check of the expected output.
Cons
A difference can be intentional. Check whether your chosen canonical matches the intended page.
Troubleshooting
Check the input format and compare your case with the built-in sample. A difference can be intentional. Check whether your chosen canonical matches the intended page.
Common issue and what to check
If you expected the paths to match, check trailing slashes, case, and escaped characters. Run a separate test to verify actual redirects.
Frequently asked questions
How do I use the text I get back?
Copy the output into the document, list, or compatible tool where you need it.
How does the transformation work?
Parse both URLs and compare the named components.
Can I try a sample first?
Yes. Select Try a sample to load the worked example and see the expected result.
What should I check before using the result?
A difference can be intentional. Check whether your chosen canonical matches the intended page.
Is my input stored by the tool?
The transformation is computed in the open page. The tool does not save the submitted text.