Skip to content
codinganthem
All tools/Web/URL Parser

URL Parser

Parse any URL online into protocol, hostname, port, path, query parameters and hash. Free URL parser for debugging redirects, OAuth callbacks and UTM links.

More
Buy me a coffee

How to parse a URL online

Paste a full URL, including https://, and the parser splits it into its parts, each with a Copy button. It uses the browser's own URL parser, the same rules a browser follows when it opens the link.

https://api.example.com:8080/v1/users?id=7&id=9&sort=name#results

Protocol   https
Hostname   api.example.com
Port       8080
Path       /v1/users
Query      id = 7, id = 9, sort = name
Hash       results
Origin     https://api.example.com:8080

What each part means

  • Hostname is the domain or IP address alone. Origin is protocol, hostname and port together, which is what browsers compare for CORS and cookies.
  • Port is empty when the URL uses the default for its protocol (443 for https, 80 for http), because the browser leaves it out.
  • Query parameters are listed one per row. A key that appears twice, like id above, is shown twice, in order; many frameworks read only the first or the last.
  • Encoded characters such as %20 or + in the query are decoded in the values shown, so you see what the server receives.
  • The hash (fragment) after # is never sent to the server. Single-page apps and OAuth implicit flows use it in the browser.

Common uses

  • Checking an OAuth redirect_uri or callback URL exactly matches what the provider has registered.
  • Reading UTM and tracking parameters in a campaign link.
  • Debugging a redirect chain or an API endpoint copied from logs.

To encode a value before you put it in a URL, use the URL Encoder. To share a long URL, shorten it with the URL Shortener.

Frequently asked questions

What are the parts of a URL?+

Protocol (https), hostname (example.com), an optional port, the path (/page), an optional query string (?key=value) and an optional fragment (#section). The origin is the protocol, hostname and port together.

Why is the port empty?+

Because the URL uses the default port for its protocol, 443 for https or 80 for http. Browsers leave the default out.

How are repeated query parameters shown?+

Each value gets its own row, in the order it appears. Servers differ in which one they use, so repeated keys are worth checking.

Why does it say the URL is invalid?+

The URL needs a protocol such as https:// at the start. Without one, the browser's parser can't tell where the host begins.

Is the hash sent to the server?+

No. Everything after # stays in the browser, so a server never sees it in the request.