Query Params to JSON
Paste a full URL or just the query string to get a structured JSON object. Repeated keys become arrays.
What is query string parsing?
A query string is the key=value list after ? in a URL. The WHATWG URL Standard defines URLSearchParams: keys and values are application/x-www-form-urlencoded, + means space, and repeated keys are allowed. This tool folds those entries into a JSON object for inspection and fixtures. See the URL Standard (URLSearchParams).
Paste a full URL, a protocol-relative URL, a query string with or without a leading ?, or even a hash-style string starting with #. The parser pulls the search part with the URL constructor when a scheme or // is present, then feeds the remainder to URLSearchParams. Plus signs and percent-escapes are decoded the same way a browser would decode a form GET. If the same key appears twice, the values become a JSON array in the order they appeared. An empty value (empty=) is stored as "". The result is pretty-printed JSON you can copy. Invalid URLs that still are not a bare query string show a parse comment instead of throwing. Decoding happens only on this device. To percent-encode or decode a whole URL, use the URL Encoder.
When to use this tool
- Debug a request URL — Paste the address bar or a log line and read every parameter without counting ampersands.
- UTM and campaign tags — utm_source, utm_medium, and similar keys decode into a flat object you can drop into analytics notes.
- Multi-select filters — tags=js&tags=css becomes "tags": ["js", "css"] instead of silently keeping only the last value.
- Encode the other direction — When you need to build a query string from text, use URL Encoder rather than reversing this object by hand. URL Encoder
How to use the Query Params to JSON
Paste a URL or query string
Full URLs (https://example.com/search?q=hello+world), protocol-relative URLs (//cdn.example/path?x=1), ?q=hello, or q=hello are all accepted. Sample loads a search URL with a repeated tags key and an empty parameter.
Read the JSON object
Keys are unique except when repeated, in which case the value is an array. The param count in the output header is the number of keys, not the number of raw pairs.
Copy
Copy JSON places the pretty-printed object on the clipboard. Empty input yields an empty output pane.
Worked examples
Full URL, plus-encoding, repeated keys, empty value
https://example.com/search?q=hello+world&page=2&sort=desc&tags=js&tags=css&empty=
{
"q": "hello world",
"page": "2",
"sort": "desc",
"tags": [
"js",
"css"
],
"empty": ""
}hello+world becomes hello world. tags is an array because the key appeared twice.
+ and %20 both decode to a space
q=hello+world&q2=hello%20world
{
"q": "hello world",
"q2": "hello world"
}Bare query with a leading question mark
?utm_source=newsletter&utm_medium=email
{
"utm_source": "newsletter",
"utm_medium": "email"
}Tips
- page=2 is the string "2", not a number — query strings have no types.
- Protocol-relative URLs starting with // are prefixed with https: so the URL constructor can parse them.
- A URL with no query (no ? and no key=value text) yields {}.
- Pretty-print or minify the object in JSON Formatter if you are pasting it into a fixture file.
Frequently Asked Questions
Do I need to paste the whole URL?
No. A query string with or without ? is enough. A full URL is convenient when you copy from the address bar; the path and host are ignored after the search part is extracted.
How are repeated keys represented?
The first occurrence stores a string. Each later occurrence of the same key promotes the value to an array and appends. Order follows the query string, so tags=js&tags=css becomes ["js","css"].
Are values URL-decoded?
Yes, through URLSearchParams. + and %20 become spaces, %26 becomes &, and other percent-escapes follow the form-urlencoded rules. Hash fragments are not treated as query parameters unless you paste only the fragment after stripping to a # query (the tool strips a leading # as well as ?).
What does an empty parameter become?
empty= (nothing after the equals) becomes the empty string "". A key with no equals at all is stored as an empty string as well, which is URLSearchParams behavior.
Is the URL sent to a server?
No. URL and URLSearchParams run in the browser. Query strings that contain tokens or PII never leave the device.