Developer

URL Parser

Break a URL into host, path and query parts.

Enter a full URL (including http:// or https://) and press Parse.

What is this tool?

The URL parser breaks a URL into its protocol, hostname, port, pathname, hash and query parameters. Useful for inspecting API request URLs or checking query string structure. It uses the browser's built-in URL object.

What each field means
  • Protocol: the scheme including the colon, e.g. https:.
  • Hostname: the domain or IP address, without the port.
  • Port: the port explicitly specified in the URL; empty if omitted.
  • Query parameters: each key=value pair after ? shown as a row; repeated keys appear as separate rows.
Privacy & processing

All parsing uses only the browser's built-in URL object. Your URL is never uploaded or stored.

URL structure — the 5 standard components

Per RFC 3986, a URL (URI) is made of five parts: scheme, authority, path, query, and fragment. The authority further splits into userinfo, host, and port. Breaking down https://user@a.com:8080/p/q?x=1#h gives:

ComponentValueMeaning
Schemehttps:The protocol prefix
Authorityuser@a.com:8080Userinfo + host + port
Path/p/qResource location on the server
Query?x=1key=value parameters sent to the server
Fragment#hClient-only location, never sent to the server

This tool splits these five parts precisely using the browser's built-in URL object. The fragment's key difference: it never leaves the browser.

Why percent-encoding exists, and the + vs %20 trap

The URI spec treats only letters, digits, and a few symbols (-._~) as safe; spaces, non-ASCII text, and characters with special meaning like &, ?, # must be percent-encoded (% plus two hex digits). Skip this and an & can be misread as a parameter separator, or a space can truncate the URL mid-parse.

Real-world trap: encodeURIComponent(' ') produces %20, but form-encoded query strings (application/x-www-form-urlencoded) treat + as a space instead. A literal + (like the one in user+tag@a.com) must be encoded as %2B or it gets decoded as a space — confirmed by new URLSearchParams('q=a+b').get('q') returning 'a b'.
What does the URL parser do?
Enter a URL and it splits out the protocol, hostname, port, pathname, hash, and query parameters into a table, using the browser's built-in URL object for accurate parsing.
What happens with multiple or duplicate query parameters?
Parameters with the same name appear as separate rows. For example ?tag=a&tag=b becomes two rows, tag=a and tag=b. Parameters without a value (?flag) show an empty value.
Does it handle URLs without a port or query?
Yes. If the port is omitted the port field is left blank, and if there are no query parameters it shows "No query parameters".
What happens with an invalid URL?
If the browser's URL constructor fails to parse the input (missing protocol or malformed), an error message "Not a valid URL" is shown. You must include http:// or https:// in the input.
Is my URL sent to a server?
No. Parsing uses only the browser's built-in URL object; your URL is never uploaded or stored.
What components make up a URL?
Per RFC 3986, a URL (URI) consists of five parts — scheme, authority (userinfo, host, port), path, query, and fragment. Only the fragment stays in the browser and is never sent to the server.
Why is percent-encoding (%20, etc.) needed?
Characters outside letters, digits, and a few symbols (spaces, non-ASCII text, &, ?, # etc.) have special meaning or aren't allowed in URL syntax, so they must be percent-encoded (% plus two hex digits). Without encoding, an & can be misread as a parameter separator or a space can truncate the URL.
Can I use + for a space in a query string?
Not always — be careful. In form-encoded query strings (application/x-www-form-urlencoded), + is decoded as a space, while encodeURIComponent(' ') produces %20. A literal + (as in an email address) sent in a query must be encoded as %2B or it will be read as a space.