3tej home

What is URL Parser?

A URL Parser computes url parser from the inputs you provide. It applies the standard formula to the values you enter and returns the result instantly, without sending any data to a server. Decompose any URL into protocol, host, port, path, query parameters, hash fragment.

URL Parser

Break a URL into protocol, host, port, path, query params, hash. Browser-native via URL constructor.

🔒 Browser-only ⚡ Instant 💸 Free forever 📡 Works offline 🚫 No signup
← Utilities

TLDR

Paste a URL, the tool runs new URL(input) and displays each component on its own line - including each query parameter parsed out. Useful for debugging OAuth redirects, deep links, and complex API URLs.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About URL structure and parsing

A URL parser breaks a web address into its component parts: protocol, host, port, path, query string, and fragment. Rather than squinting at a long string to find a single query parameter or check which port is set, you paste the URL and see every piece laid out. This tool uses the browser's native URL constructor, the same engine your code uses, so the breakdown matches exactly how a browser interprets the address.

URLs follow the structure defined by RFC 3986. The general shape is scheme://host:port/path?query#fragment. Each section answers a different question: the protocol says how to connect, the host and port say where, the path says which resource, the query passes parameters, and the fragment points to a location within the resource. Understanding these boundaries is essential when debugging redirects, deep links, OAuth callbacks, and API requests.

The parser is especially useful for inspecting complex query strings, where many key-value pairs are packed after the question mark and percent-encoding hides the real values. It decodes and lists each parameter on its own line so you can verify exactly what an application is sending. Everything runs locally in your browser, so even URLs that carry access tokens or session identifiers never leave your device, which makes it safe to inspect sensitive callback links.

How the parser works

The tool passes your input to the browser URL constructor and reads back each property, then enumerates the query parameters.

u = new URL(input)
protocol  = u.protocol      host = u.host
hostname  = u.hostname      port = u.port
path      = u.pathname      query = u.search
hash      = u.hash          origin = u.origin
params    = [...u.searchParams.entries()]  (auto percent-decoded)

Because this is the standard URL API, parsing is identical across Chrome, Firefox, Safari, and Node. The constructor requires an absolute URL with a scheme; a bare domain or relative path will throw, which is itself a useful signal that the address is malformed.

Worked example

Parse https://www.example.com:8080/api/v1/users?id=123&sort=desc#section.

ComponentValue
Protocolhttps:
Hostnamewww.example.com
Port8080
Path/api/v1/users
Query?id=123&sort=desc
Fragment#section
Originhttps://www.example.com:8080

The two query parameters parse out as id = 123 and sort = desc. The fragment section stays on the client and is never sent to the server.

URL component reference

PartExampleSent to server?
Protocolhttps:Determines the connection
Hostexample.com:8080Yes, as the Host header
Path/api/usersYes
Query?id=123Yes
Fragment#sectionNo, client-only

Common mistakes and pitfalls

  • Omitting the protocol. The URL constructor needs an absolute address. example.com/page throws; https://example.com/page works.
  • Forgetting query values are percent-decoded. The parser shows the decoded value, so %40 appears as an at sign. Re-encode before reusing in a new URL.
  • Assuming the fragment reaches the server. Anything after the hash is client-only and never appears in server logs or requests.
  • Expecting one value per key. Query strings can repeat a key; the parser keeps each occurrence rather than collapsing them.
  • Leaving spaces in the URL. Raw spaces and other special characters must be percent-encoded or parsing fails.

Related tools

URL Encoder / Decoder

Percent-encode or decode individual URL components.

Query String Builder

Assemble a query string from key-value pairs.

Base64 Encoder

Encode and decode Base64, often found inside URLs.

JSON Formatter

Pretty-print JSON returned from the API you are debugging.

Frequently asked questions

What are the parts of a URL?

A URL is made of a protocol (such as https), an optional userinfo, a host (hostname plus optional port), a path, an optional query string after the question mark, and an optional fragment after the hash. In https://www.example.com:8080/api/v1/users?id=123#section, the protocol is https, the host is www.example.com:8080, the path is /api/v1/users, the query is id=123, and the fragment is section. This parser splits any URL into exactly these components.

What is the difference between host and hostname?

Hostname is just the domain, such as www.example.com. Host is the hostname plus the port when a non-default port is present, such as www.example.com:8080. If the URL uses the default port for its protocol (443 for https, 80 for http), the port is omitted and host equals hostname. The parser shows both fields so you can see whether an explicit port is set.

How are query string parameters parsed?

Everything after the question mark is the query string, split into key-value pairs on ampersands, with keys and values separated by equals signs. The browser URL and URLSearchParams APIs automatically percent-decode each value, so %20 becomes a space and %40 becomes an at sign. The parser lists each parameter on its own line. Repeated keys are kept as separate entries rather than overwritten.

Does the fragment (hash) get sent to the server?

No. The fragment, the part after the hash, is handled entirely by the browser and is never sent in the HTTP request. It is used to scroll to an anchor on the page or to hold client-side state in single-page apps. That is why authentication tokens are sometimes returned in the fragment: they stay on the client and do not appear in server logs.

Why does my URL fail to parse?

The most common cause is a missing protocol. The URL constructor needs an absolute URL, so example.com/page fails but https://example.com/page works. Other causes are spaces or unescaped special characters in the URL, which should be percent-encoded first. A relative path on its own cannot be parsed without a base URL to resolve it against.