Back to blog

URLQuery ParametersAPI DebuggingDeveloper Tools

URL Parser: Components and Query Parameters

Parse a URL into its protocol, host, domain, port, path, query parameters, and fragment. Learn decoding, repeated parameters, JSON copying, and debugging steps.

A URL parser breaks a complete web address into its protocol, host, port, path, query parameters, and fragment. Paste an address into the online URL parser and the tool exposes each component locally in your browser. It is useful for inspecting API requests, callback addresses, shared links, and URLs filled with tracking parameters.

What Components Does a URL Parser Extract?

Consider a URL containing most of the common components:

text
https://alice@example.com:8080/products/search?q=phone&sort=price&page=2#reviews

The parser separates it as follows:

Component Example result Purpose
Protocol https: Identifies the URL scheme
Username alice User information in the URL; uncommon on ordinary web pages
Host example.com:8080 Domain and explicit port together
Hostname example.com Host name without the port
Port 8080 Explicit service port
Path /products/search Locates a resource within the site
Query string ?q=phone&sort=price&page=2 Passes parameters to a page or API
Fragment #reviews Points to an in-page location or client-side state

Host and hostname are easy to confuse. The host includes an explicit port, while hostname does not. That distinction matters when debugging reverse proxies, cross-origin requests, and callback allowlists because a different port can identify a different target.

RFC 3986 describes the generic URI syntax. Actual browser behavior follows the Web platform's URL parsing rules; the examples in this article reflect the browser URL interface used by this tool.

How to Use the Online URL Parser

  1. Open the URL parser
  2. Paste a complete URL, or enter a domain and path without a protocol
  3. Select “Parse URL” to inspect the components and query parameter table

You can also press Ctrl + Enter, or Command + Enter on macOS. If the input is example.com/docs?page=2, the tool temporarily prepends https:// before parsing, so the result displays https: as the protocol.

“Clear” resets both the input and results. The tool does not request the URL you enter or upload it to a server; it only uses the parser built into the current browser. Even so, inspect the URL for tokens, email addresses, user identifiers, or other sensitive values before sharing a result or screenshot.

How URL Query Parameters Are Parsed

Query parameters follow the question mark ?. They usually consist of name-value pairs separated by &:

text
https://example.com/search?q=phone&sort=price&page=2

The tool displays them as:

Parameter Value
q phone
sort price
page 2

This table is easier to inspect than one long line when checking whether a parameter is missing, a value is incorrect, or repeated values appear in the expected order.

Percent-Encoded Text Is Displayed Readably

Parameter names and values are decoded according to URL rules. For example:

text
q=red%20shoes

appears as red shoes. The parser separates the structure and displays decoded parameter values. To encode or decode a standalone value, use the URL encoder and decoder. The percent-encoding guide also explains spaces, plus signs, and double encoding.

Repeated Parameter Names Remain Separate in the Table

Multi-select filters often use a URL like this:

text
https://example.com/products?tag=new&tag=sale&tag=popular

The results table retains all three tag entries in their original order. That matters because converting query parameters into a plain object too early can discard earlier values with the same name.

The page also has a “Copy JSON” button for moving parameters into a log or debugging note. Its current implementation uses a regular JSON object, which cannot contain duplicate keys reliably. For the example above, the copied JSON keeps only the final tag value, popular. When repeated parameters matter, use the displayed table as the source of truth or represent the data as an array of name-value pairs.

A Callback Port or Path Does Not Match

OAuth, payment, and webhook callbacks often require an exact address match. Parse the expected and actual URLs separately, then compare protocol, hostname, port, and path one field at a time. Similar-looking prefixes do not prove that two callback URLs are equivalent.

A Query Parameter Contains Another Encoded URL

Login flows often place a second URL inside a redirect or returnUrl parameter. Parse the outer URL first, locate the redirect value, and then parse that value as a second step. If it contains dense percent encoding, restore one layer with the URL decoder. Processing one layer at a time makes it easier to identify where the value changed.

A Fragment Is Mistaken for a Server Parameter

The fragment after # is normally not sent as part of an HTTP request. If a server endpoint is expected to read a value after #reviews, recheck the design. The parser lists the fragment separately so it is not confused with the query string.

Copied Parameter JSON Needs Inspection

After copying the parameter JSON, paste it into the JSON formatter to inspect its structure and syntax. If the original URL contains repeated parameters, first verify that converting them to a JSON object has not removed values.

URL Parser vs. URL Encoder and Decoder

Task Recommended tool
Inspect protocol, hostname, port, and path URL parser
List query parameters individually URL parser
Convert spaces or special characters to percent encoding URL encoder/decoder
Restore %20 or other encoded sequences URL encoder/decoder
Understand what a long URL sends Parse first, then decode specific values

The tools solve different problems. Parsing answers “What components make up this URL?” Encoding answers “How are these characters represented safely?” For a complex link, inspect the structure first and then encode or decode an individual parameter when needed.

FAQ

Can the Tool Parse a URL Without https://?

Yes. It temporarily adds https:// to input without a protocol. This makes the string parseable as an absolute URL; it does not prove that the original text explicitly declared HTTPS.

Why Is the Port Field Empty?

The port field is empty when the input does not explicitly specify one. Although a browser can use a default port based on the protocol, the tool does not invent a port that was absent from the input.

Why Is Percent-Encoded Text Readable in the Parameter Table?

The browser's URLSearchParams parser restores percent-encoded parameter names and values according to URL rules, so the table can show readable text.

Does Copy JSON Preserve Repeated Query Parameters?

Not completely. The table preserves repeated entries, but the current JSON copy action builds a regular object, so only the last value for a repeated key remains.

Is the URL Sent to a Server?

No. This tool parses the input in the current browser and does not actively visit or upload the URL.

Summary

When a long URL is difficult to read, separate its protocol, host, port, path, query parameters, and fragment before investigating encoding errors. The URL parser provides that first structural view. For nested redirects, percent encoding, and repeated parameters, work through the real values one layer at a time rather than guessing from the original line.

On this page