URL Parser
Break any URL into scheme, credentials, host, port, path segments, query parameters and fragment, with decoded values and JSON output. Runs in your browser.
| Scheme (protocol) | https: |
|---|---|
| Username | user |
| Password | pass |
| Host name | shop.example.com |
| Port | 8080 |
| Path | /products/shoes |
| Path segments (decoded) | 1. products 2. shoes |
| Query string | ?color=red&size=42 |
| Fragment | #reviews |
| Origin | https://shop.example.com:8080 |
| Normalized URL | https://user:pass@shop.example.com:8080/products/shoes?color=red&size=42#reviews |
| Key | Decoded value |
|---|---|
| color | red |
| size | 42 |
{
"protocol": "https:",
"username": "user",
"password": "pass",
"hostname": "shop.example.com",
"port": "8080",
"pathname": "/products/shoes",
"search": "?color=red&size=42",
"hash": "#reviews",
"origin": "https://shop.example.com:8080",
"params": {
"color": "red",
"size": "42"
}
}What is URL Parser?
The URL parser splits a URL into its components – scheme, username, password, host name, port, path, path segments, query string, individual query parameters and fragment – and shows the origin and the normalized URL. Percent-encoded values are decoded, internationalized host names are shown in both punycode and Unicode, and repeated parameters are kept.
How to use URL Parser
- Paste an absolute URL, for example
https://user:pw@example.com:8080/a/b%20c?x=1&y=two#h. - Read the component table; the port row shows the default port when none is given.
- Check the query parameter table for each decoded key and value.
- Copy the JSON block to use the parsed result in code or tests.
Example
https://user:pw@example.com:8080/a/b%20c?x=1&y=two#h
host example.com · port 8080 · path segments: 1. a, 2. b c · query ?x=1&y=two (x = 1, y = two) · fragment #h
When to use URL Parser
Use it to debug tracking links, OAuth redirect URLs, signed URLs or API calls with many parameters. It only parses absolute URLs; for relative paths add a base such as https://example.com first. It does not visit the URL.
How URL Parser works
The URL is parsed with the browser's built-in WHATWG URL class – the same parser browsers use for navigation – so the result matches real browser behaviour (lower-cased host, resolved dot segments, punycode for IDNs). Query parameters come from URLSearchParams, which decodes + as a space and percent-escapes as UTF-8. Path segments are decoded with decodeURIComponent and left as-is if they contain an invalid escape.
Common Use Cases
- Read UTM and click-ID parameters from a marketing link.
- Inspect the redirect_uri and state of an OAuth authorization URL.
- Decode a percent-encoded path segment to see the original file name.
- Find the punycode form of an internationalized domain.
FAQs
Why is my URL reported as invalid?
The parser needs an absolute URL with a scheme. example.com/page is a relative reference; write https://example.com/page.
Why did + turn into a space?
In the query string, URLSearchParams follows the HTML form encoding where + means space. Use %2B for a literal plus sign.
Is the URL sent anywhere?
No, parsing happens entirely in your browser.