Query String to JSON
Convert query string to JSON
What Is This Tool?
The Query String to JSON tool parses a URL query string back into a JSON object, using URLSearchParams for flat keys and decoding the key[0]= / key[nested]= bracket convention into nested arrays and objects. It's the inverse of JsonCherry's JSON to Query String tool. Everything runs locally in your browser.
How to Use
Paste a query string, with or without a leading "?".
Click Convert.
Copy the resulting pretty-printed JSON.
Features
- Accepts a leading "?" or a bare query string
- Repeated flat keys (key=a&key=b) become an array of values
- Decodes key[0]= and key[nested]= bracket notation into nested arrays/objects
- Automatically percent-decodes keys and values
- 100% client-side — nothing is uploaded anywhere
Examples
Input:
name=Alice&tags[0]=a&tags[1]=b&address[city]=NYC
Output:
{
"name": "Alice",
"tags": ["a", "b"],
"address": {
"city": "NYC"
}
}
Common Use Cases
- Inspecting the parameters of a URL you're debugging
- Converting a captured request's query string into JSON for a test fixture
- Reversing output from JsonCherry's JSON to Query String tool
- Understanding how a backend using the bracket convention would parse a URL
Frequently Asked Questions
Is the bracket notation for nested data a web standard?
No. There's no official standard for nested query string parameters. This tool decodes the common key[0]=, key[nested]= convention (used by PHP, Rails, and libraries like "qs"), but not every backend follows it, so treat the nested output as one common interpretation, not the only correct one.
What happens with a repeated key that has no brackets?
A key that appears more than once without brackets (e.g. tag=a&tag=b) becomes a JSON array of its values, matching how URLSearchParams exposes repeated keys.
Do I need to include the leading question mark?
No. You can paste the query string with or without a leading "?" — it's stripped automatically before parsing.
Are percent-encoded characters decoded?
Yes. Parsing uses the browser's URLSearchParams, which automatically decodes percent-encoded characters (like %20 for a space) in both keys and values.
Can I mix repeated keys and bracket notation in the same string?
Yes, the parser handles both conventions in the same input, as shown in the example (a repeated-looking tags[0]/tags[1] pair alongside a plain nested address[city] key).
Is my query string sent to a server?
No. All parsing happens entirely in your browser using JavaScript. Nothing is uploaded anywhere.