URL Parser

Break a URL into host, path, query and fragment.

About URL Parser

A URL parser breaks a URL into protocol, origin, hostname, port, path, query and fragment and lists each query parameter decoded. Results appear as you type.

How to use

  1. Paste a full URL including the scheme, for example https://. Parsing happens as you type.
  2. Read the parts on the left: protocol, origin, hostname, port, path, query and fragment, plus username and password when the URL contains them.
  3. Read the query parameters on the right, one row per key with its percent-decoded value.
  4. Copy any single value with its row button, or Copy on either panel to get all rows as label: value lines.

What it supports

  • Uses the browser's URL class, so parsing follows the WHATWG URL Standard that browsers use: hostnames are lowercased, default ports are dropped and the path is normalised.
  • Query values are decoded with URLSearchParams, so %20 and + both show as a space. Repeated keys appear as separate rows.
  • Relative URLs and bare hostnames such as example.com/page are rejected with an error, because the parser needs a scheme.
  • Port is empty when the URL uses the default port for its scheme (80 for http, 443 for https).
  • Does not fetch the URL or check that the host exists.

Example

https://example.com:8080/path/to/page?q=search&page=2#top
→ Protocol  https:
→ Origin    https://example.com:8080
→ Hostname  example.com
→ Port      8080
→ Path      /path/to/page
→ Query     ?q=search&page=2
→ Fragment  #top
→ q = search · page = 2

Privacy

Parsing runs in the browser. No request is made to the URL or anywhere else, and nothing is stored.

Frequently asked questions

What are the parts of a URL?
Scheme (https), optional user info, host, optional port, path, optional query starting with ? and optional fragment starting with #. Together scheme, host and port form the origin, which browsers use for the same-origin policy.
What is the difference between a query string and a fragment?
The query (?key=value) is sent to the server with the request. The fragment (#section) is never sent; the browser uses it locally to scroll to an element or to drive client-side routing.
Why is the port empty for an https URL?
Because 443 is the default port for https, and the WHATWG URL parser drops a port that matches the scheme default. The same happens for port 80 with http.
Is it safe to paste a URL with a token into a parser?
This parser never sends the URL anywhere, so the token stays in your browser. Treat any URL containing a token or password as a credential and avoid sharing it in screenshots or logs.