URL normalize
url-normalize · version 1.0.0 · URLs & IP addresses · free, no key needed
Normalize an absolute http or https URL via WHATWG parse. No DNS, fetch, or security-equivalence claim.
Use when you need to: url normalize · canonicalize http url · normalize https url.
Supported
- url normalize
- canonicalize http url
- normalize https url
Not supported
- fetch
- dns
- punycode security claim
- http equals https
Behavior
- Parse with WHATWG URL. Scheme must be http or https (case-insensitive on input). Reject other schemes, relative URLs, and credentials-less parse failures.
- Always applied: WHATWG href serialization (scheme lowercase, host lowercase ASCII/punycode as WHATWG does, default ports 80/443 omitted, empty path becomes /, dot-segment removal).
- strip_fragment default false; if true, drop the fragment.
- Preserve userinfo if present. Do not sort query. Do not claim two URLs are security-equivalent or same-origin beyond the returned string.
- No network.
Input
url(string, required): min length 1; max length 8192strip_fragment(boolean, optional)
Output
url(string, required)
Limits
- max url bytes: 8192
Example
Request input:
{
"url": "HTTP://Example.COM:80/a/../b"
}
Response:
{
"result": {
"url": "http://example.com/b"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "url-normalize",
"version": "1.0.0",
"input": {
"url": "HTTP://Example.COM:80/a/../b"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/url-normalize/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"url":"HTTP://Example.COM:80/a/../b"}'
The machine-readable contract is at /v1/tools/url-normalize/versions/1.0.0.
CLI
node cli.mjs run url-normalize 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- IPv6 normalize: Normalize any valid textual IPv6 address directly into its RFC 5952 canonical compressed string.
- URL query build: Build a query string or replace an absolute URL query from ordered pairs. No fetching.
- URL query merge: Merge query pairs into an absolute URL. No fetching.
- URL query parse: Parse query pairs and fragment from an absolute URL. Parse only; no fetching.
- URL resolve: Resolve a URL against an absolute http(s) base using WHATWG. No fetching. Result must be http(s).
- IPv4 address classify: Classify an IPv4 address against the static IANA IPv4 special-purpose address registry.