๐ URL Parser
| Key | Value |
|---|---|
| foo | 1 |
| bar | two |
Enter a URL and this tool automatically breaks it down into its protocol, hostname, port, path, query parameters, and hash (fragment). Query parameters are shown as an easy-to-read table. Useful for understanding a complex URL's structure or checking a URL while debugging.
How to use
- Paste the URL you want to break down into the input field.
- Each part of the URL is broken down and shown automatically.
- If there are query parameters, they're also shown as a table of keys and values.
How the calculation works
This tool splits a URL into its parts using the browser's standard URL API. URLs follow the WHATWG URL Standard and are built like this: https://username:password@hostname:port/path?query#fragment โข Protocol (scheme): https, http and so on โข Hostname: the server name, such as example.com โข Port: if omitted, 80 for http and 443 for https โข Path: the location on the server โข Query: "key=value" pairs after "?", separated by "&", listed in a table โข Fragment: the part after "#", which points within the page and is never sent to the server Query values that are percent-encoded (such as %E6%97%A5) are shown decoded.
Worked example
Input: https://user:pass@example.com:8080/path/to/page?foo=1&bar=two#section Protocol: https Username: user, password: pass Hostname: example.com Port: 8080 Path: /path/to/page Query: foo = 1, bar = two Fragment: section A Japanese domain such as https://ไพใ.jp/ shows its hostname as xn--r8jz45g.jp (Punycode).
Things to be aware of
- Putting a username and password in a URL is often abused for phishing, so many browsers warn about or restrict it.
- Paths containing non-ASCII characters are shown percent-encoded (%E3%83%91โฆ).
- Strings without a scheme such as "https://" cannot be parsed as URLs.
FAQ
What happens if I enter an invalid URL?
An error message appears if the string can't be parsed as a valid URL.
Does this handle URLs with credentials (username/password)?
Yes, URLs in the form "user:pass@example.com" are parsed correctly and shown in the credentials field.
Does this handle relative URLs?
No, the current version only supports absolute URLs that start with a protocol.