๐Ÿ”— URL Parser

URL
Protocolhttps
Hostnameexample.com
Port8080
Credentialsuser:pass
Path/path/to/page
Hashsection
Query parameters
KeyValue
foo1
bartwo

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

  1. Paste the URL you want to break down into the input field.
  2. Each part of the URL is broken down and shown automatically.
  3. 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.