URL Parser

Free URL parser. Decompose a URL into its protocol, hostname, port, pathname, query parameters, and fragment, with auto-https when no scheme is given.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent โ€” no API key needed.

API docs
โ€”
Enter a URL above.

How url parser works

A URL is made of several parts: a scheme (protocol), an authority (userinfo, host, port), a path, an optional query string, and an optional fragment. The WHATWG URL Standard defines how these fit together, and the browser's built-in URL parser resolves them into a structured object.

This parser uses the standard URL parser to break a URL into protocol, hostname, port, pathname, query parameters (as an object), and hash. If you omit the scheme it assumes https, so "example.com/path" is treated as "https://example.com/path". It reports whether a query string or fragment is present and lists each query parameter as a key-value pair.

Paste a URL to inspect or debug it โ€” useful when building links, decoding marketing parameters, or auditing redirect chains. The parser follows the same rules browsers use, so the result matches what a browser would send to a server.

Frequently asked questions

What happens if I omit the scheme?
The parser assumes https, so "example.com/path" is read as "https://example.com/path". This matches how browsers auto-complete addresses typed without a protocol.
How are query parameters returned?
As an object mapping each parameter name to its value. For "?x=1&y=2" the queryParams object is { "x": "1", "y": "2" }. Repeated keys keep the last value, matching the URLSearchParams convention.
Does it decode percent-encoded characters?
The hostname and pathname keep their original encoding as the browser sees them, while query parameters are parsed through URLSearchParams, which decodes standard percent-encoding and plus signs for spaces.
What makes a URL invalid?
A URL that the WHATWG parser cannot resolve โ€” for example a scheme it does not understand or a malformed host. The parser reports "invalid URL" with the underlying error rather than guessing.