URL Parser

Web

Parse a URL into protocol, host, path, query, hash components with query parsing. Break links apart for redirects, analytics and quick link debugging.

Valid · 3 params
Protocolhttps
Hostnameexample.com
Port8080
Pathname/path/to/page
Hash#section
Usernameuser
Password••••••••
Originhttps://example.com:8080
?=Query params · 3
q=hello
lang=en
tag=dev

About URL Parser

You reach for this when a long address needs taking apart. Maybe the query string did not resolve the key-value pairs you expected, the classic "the parameter never reached the backend"; maybe you need the path/query boundary for a third-party callback. It also covers pulling every tracking parameter out of a campaign link, or seeing how a relative reference joins its base before you write a scraper. Counting slashes and question marks by hand is slow and error-prone, while a parser yields structure in seconds. Parsing follows the URL standard, splitting an address into scheme, host, port, path, query and fragment, with the query further divided on ampersands into key-value pairs, and the fragment after a hash never being sent to the server. That structure explains several everyday phenomena, including why anything after a hash never appears in server logs, which is exactly why early single-page apps used hash routing and why analytics parameters placed after a hash silently fail. Practical notes: Separate absolute from relative references first, since a relative one needs a base or the result is wrong. Percent-encoding inside a path must be decoded to see the real directory name, but be careful because a decoded slash changes path depth, so decode before validating rather than the other way around when making security decisions. The same key appearing multiple times in a query string is valid per the standard, as with multi-select filters, so resolving into an object drops duplicates; parse into a list of pairs when all values matter. And remember that a plus sign means a space in the query string, unlike in the path. Limits: The URL standard and the older RFC 3986 disagree on details such as backslash handling, path normalization of empty prefixes, and how credentials before the host are parsed, so different languages and browsers can produce different results. If a parse feeds a security decision, such as a domain allowlist or redirect target check, use the same implementation as the target runtime or avoid parsing altogether and pin the destination with an allowlist. Internationalized domains are Unicode when displayed and punycode (with an xn-- prefix) on the wire, so normalize before comparing or one domain looks like two. Another trap is default-port equivalence: an explicitly written default port and an omitted one differ as strings but not in meaning, so normalize before comparing. Data and privacy: the addresses being parsed often carry signature parameters, access tokens, session identifiers or user identity, and sharing one discloses access. This tool parses and decodes in the browser, contacts no service and uploads nothing. Once you have finished troubleshooting, rotate any token that appeared in the URL. In log analysis, parsing request addresses into structured fields and aggregating by host and path quickly reveals the ratio of crawlers to real users and which endpoints are hit hardest. For redirect safety checks, decode first and compare second, and compare normalized forms only, with hostnames lowercased, default ports removed, and punycode reconciled with Unicode, otherwise a carefully constructed bypass passes the allowlist. Persist the parsed result as structured records so downstream code stops re-slicing strings and stops reintroducing errors.

How It Works Internally

Parsing follows the URL standard and splits an address into scheme, host, port, path, query and fragment, with the query divided on ampersands into key-value pairs. The fragment after a hash is never sent to the server, which explains both hash routing in early single-page apps and why analytics parameters placed there never work. Repeating a key is valid per the standard, so resolving into an object drops values.

The component parts
Inputhttps://oltool.net/a/b.html?x=1&x=2#top
Outputhost=oltool.net | path=/a/b.html | query=[x=1, x=2] (two entries, not one) | fragment=top (never sent to the server)

Measured on This Page

Full URLuserinfo, non-default port, multiple parameters and a fragment all split correctly
Missing partsAn empty path shows /; port 80 on http shows empty — correct, since a port equal to the scheme default is omittable
Encoded paramsq=a%20b decodes to a b and an empty-valued empty= survives as an empty string
Duplicate keysq=1&q=2 lists both in appearance order instead of keeping the last
CaseEXAMPLE.com is lowercased (domains are case-insensitive) while /Path keeps its case (paths are not)
CJK paramsAn unencoded Chinese parameter value displays as-is

Parameters follow the parse_qsl convention: every key gets its own row, duplicates are not merged, and order follows appearance. Two correct behaviours that look like bugs: default ports (80/443) show empty because the URL spec makes them omittable, and hostnames are lowercased while paths are not, because domains are case-insensitive but paths are case-sensitive. The page requires a full URL with scheme — a bare example.com/path is rejected, same as in browsers.

How this was measured: Six URLs were entered and compared field by field against urllib.parse.urlsplit plus parse_qsl run independently, with the parameter list compared as a whole including order and duplicate keys. · Measured 2026-10-29

How to Use

  1. Open "URL Parser"
  2. Paste the full link into the input at the top
  3. Read protocol, host, port and path as they split out
  4. Check each query parameter and copy its value
  5. Inspect the hash and credential fields in the cards

Use Cases

  • Verify callbacks — Break down an OAuth redirect_uri to confirm code and state are passed correctly.
  • Strip tracking — See utm_source, gclid, and other marketing params to decide what to keep or remove.
  • Debug redirects — Analyze each hop's query string to find where a parameter is lost or mis-encoded.
  • Parse deep links — Open app deep links or custom schemes to inspect path and parameter structure.
  • Encoding checks — Detect doubly percent-encoded values that break server-side parsing.
  • Debug webhook payloads — Parse the URL from a webhook POST to verify the path and query params match the expected endpoint signature.
  • Inspect hash routing — Break down a SPA hash URL (#/path?param=value) to debug client-side routing behavior.

FAQ

Is the hash sent to the server?

No. The fragment identifier is client-only; browsers do not send the # and everything after it with requests. It is commonly used for frontend routing and in-page anchors.

Does + mean space in a query?

In application/x-www-form-urlencoded context, + means a space, but in a path or standard percent-encoding, + is a literal plus. The tool decodes per spec, so mind the source context.

What about repeated parameter names?

URLs allow duplicate keys like ?tag=a&tag=b. The tool lists them all; how the server reads them depends on its framework (first, last, or array).

Why do some chars show as %E4%B8%AD?

That is percent-encoded UTF-8, common for non-ASCII like Chinese. The tool tries to decode it to readable text, leaving it as-is if the encoding is invalid.

Can it build a URL in reverse?

This tool focuses on parsing. To assemble or encode query parameters into a new URL, pair it with our URL encoding tools for the reverse operation.

What is the difference between hash and search in a URL?

search is the query string after ? and is sent to the server; hash is the fragment after # and stays in the browser. SPA routing puts state in the hash or uses the history API — the two behave completely differently.

Chinese characters in the URL show as %E4%BD%A0 after parsing — why?

URLs allow ASCII only, so the browser percent-encodes non-ASCII before sending. The parser shows that encoded form, which is standard behaviour — run decodeURIComponent on the part to restore the Chinese text.

Query values are percent-encoded — can they be decoded automatically?

Keeping the raw encoding is deliberate: encoding is part of the semantics (a + in a query historically means a space, but strict parsing treats it literally). Decode individual values with decodeURIComponent; auto-decoding everything can mislead when comparing two URLs.