URL Parser and Query String Editor
Break a URL into its parts and edit its query parameters.
Use via API
Split a URL into its parts with the WHATWG URL parser: protocol, credentials, host, port (explicit, default and effective), path segments, decoded query parameters and fragment. Nothing is fetched. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/url-parser
curl https://pithlab.com/api/v1/tools/url-parser \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://shop.example.com:8443/products/red%20shoes?size=42&utm_source=newsletter#reviews"}'About the URL Parser
Split a URL into protocol, host, port, path, query parameters and hash, then edit the parameters in a table and rebuild the URL live. Nothing is fetched.
How to use the URL Parser
- Paste a full URL, including the scheme such as https://.
- Read the protocol, credentials, host name, port, path segments and hash in the breakdown.
- Edit, add or remove query parameters in the table. The rebuilt URL updates as you type.
- Copy the rebuilt URL or the full breakdown.
Examples
Input
https://example.com/blog/post?id=7&tag=news#top
Output
protocol: https: hostname: example.com port: 443 (default) pathname: /blog/post query id: 7 query tag: news hash: #top
Input
ftp://user:[email protected]:2121/pub
Output
protocol: ftp: username: user password: pass hostname: files.example.org port: 2121 pathname: /pub
Frequently asked questions
Does this tool visit the URL?
No. The URL is parsed in your browser with the standard URL parser. No request is made to the address.
Why is my URL reported as invalid?
The parser needs an absolute URL with a scheme, such as https://example.com rather than example.com. Spaces in the host name or an invalid port number also make a URL invalid.
Why does the rebuilt URL look slightly different?
Query parameters are re-encoded in the standard form, so spaces become + and special characters are percent encoded. The meaning of the URL is the same.
What is the default port?
When a URL has no port, the scheme's default is used: 443 for https and wss, 80 for http and ws, and 21 for ftp. The breakdown shows which one applies.