Normalize URLs so the same page counts once
A URL normalizer rewrites links into one standard form so that different spellings of the same page match: lowercase host, no default port, decoded safe characters, sorted query parameters, and tracking parameters like utm_source and fbclid removed. Our URL Tools API normalizes and dedupes up to 100 URLs per call for $0.002, following the WHATWG URL standard browsers use. It also parses URLs, builds UTM links and converts IDN domains with a look-alike warning.
Try it free URL Tools API — parse, normalize, UTM links, punycode, $0.002 · $0.002 / call
Before and after
in: HTTPS://Example.COM:443/a/%7Euser?utm_source=news&b=2&fbclid=abc&a=1#top
out: https://example.com/a/~user?a=1&b=2
changes: removed tracking parameters (utm_source, fbclid), sorted query parameters,
normalized percent-encoding, removed fragment
(the URL parser itself lowercases the host and drops the default :443)
Which rules are safe
Path case is never changed: /About and /about can be different pages.
| Rule | Safe? | Default |
|---|---|---|
| Lowercase scheme and host | Always | On |
| Remove :443 or :80 | Always | On |
| Decode %7E to ~ and other unreserved characters | Always | On |
| Remove utm_, fbclid, gclid and similar | Almost always | On (strip_tracking) |
| Sort query parameters | Usually; a few apps care about order | On (sort_params) |
| Remove the #fragment | Not for single-page apps that route by hash | On (remove_fragment) |
| Remove www. | Only if both hosts serve the same site | Off (remove_www) |
| Remove the trailing slash | Only if your server treats both the same | Off (remove_trailing_slash) |
Dedupe a list
curl -i -X POST https://iamai.markets/api/x402/services/93JbWgocI9-- \
-H "Content-Type: application/json" \
-d '{"action": "normalize", "urls": ["https://example.com/a?b=2&a=1", "https://EXAMPLE.com/a?a=1&b=2&utm_source=x"]}'
# After paying $0.002 by x402: unique_after_normalizing: 1
Doing it in Python
w3lib.url.canonicalize_url (from the Scrapy project) and the url-normalize package cover most of these rules in Python. Use them in a crawler you run. The API is for tools that can call HTTP but can't add a package, and for agents cleaning link lists before they fetch or compare them.
The other three actions
- parse: every part of a URL, decoded path segments and query parameters, and which parameters are trackers.
- utm: builds a campaign link with lowercase, consistent utm_ values (spaces become underscores).
- idn: converts between Unicode and punycode and warns when a domain mixes alphabets, such as a Cyrillic a in paypal. The check covers common Latin, Cyrillic and Greek tricks, not every confusable character.
The product
Questions
What is URL normalization?
Rewriting a URL into a standard form so equivalent URLs compare equal. RFC 3986 defines the safe rules; the rest are choices.
Does it follow redirects?
No. Nothing is fetched; it works on the text of the URL.
Will it remove my own query parameters?
Only known tracking ones. Others are kept and sorted.
Related
Updated 2026-12-02
