Paste a full URL or just the query string and get clean JSON instantly. Bracket notation like user[name]=Ann, arrays like tags[]=a&tags[]=b, repeated keys and percent-encoding are all handled, and the converter works the other way too: JSON in, query string out.
Last updated:
JSON
Parameters
Advertisement
Advertisement
How to use the Query String to JSON
Pick the direction: Query string to JSON, or JSON to query string.
Paste your input: a whole URL works, the part after ? is used and the #fragment is ignored.
Choose the options: how to treat repeated keys, dot notation, + as space and type detection.
Read the result on the right; it updates as you type. The table lists every parameter decoded.
Copy or download the JSON or the query string.
Query string syntax this converter understands
Query string
JSON result
name=Ann&age=31
{"name": "Ann", "age": "31"}
user[name]=Ann&user[city]=Oslo
{"user": {"name": "Ann", "city": "Oslo"}}
tags[]=a&tags[]=b
{"tags": ["a", "b"]}
items[0][id]=7&items[1][id]=9
{"items": [{"id": "7"}, {"id": "9"}]}
color=red&color=blue
{"color": ["red", "blue"]} (or first/last value)
a.b=1 (dot notation on)
{"a": {"b": "1"}}
q=caf%C3%A9+au+lait
{"q": "café au lait"}
debug (no =)
{"debug": ""}
Encoding rules worth knowing
Percent-encoding: reserved characters are written as % plus two hex digits of their UTF-8 bytes, so é becomes %C3%A9, & becomes %26 and = becomes %3D.
Spaces: + in HTML form encoding, %20 in generic URLs. A literal plus sign must be sent as %2B.
Brackets: [ and ] are technically reserved and are often sent as %5B and %5D; servers decode them before parsing nested keys, and so does this tool.
Everything is a string: a query string has no types. page=2 is the text "2" until your code converts it.
Order is preserved in the JSON output exactly as the parameters appear in the URL.
Parsing query strings in code
JavaScript: Object.fromEntries(new URLSearchParams(location.search)) gives a flat object (last value wins, no nesting). For nested brackets use the qs library: qs.parse(str). PHP fills $_GET with the same bracket rules automatically, Python's urllib.parse.parse_qs returns a dict of lists, and Ruby on Rails exposes nested params.
Frequently asked questions
How are nested parameters like user[address][city] converted?
Each bracket segment becomes one level of nesting, so user[address][city]=Paris becomes {"user": {"address": {"city": "Paris"}}}. Empty brackets (tags[]=a) append to an array, and numeric brackets (items[0]=x) set an array position. This is the convention used by PHP, Ruby on Rails and the Node.js qs library.
What happens with repeated keys without brackets?
The URL standard allows the same key several times (color=red&color=blue). By default this tool collects them into an array, like most server frameworks. You can switch to keep only the first or the last value, which matches what some frameworks and URLSearchParams.get() return.
Why is + converted to a space?
In the application/x-www-form-urlencoded format used by HTML forms and query strings, a space is encoded as +, and a literal plus sign as %2B. If your string comes from a source that encodes spaces only as %20 and uses + literally, turn off the + as space option.
Are values converted to numbers or booleans?
Not by default, because every value in a query string is text and "007" or "1e3" would otherwise change meaning. Enable Detect types to convert plain numbers, true, false and null. Leading zeros and very large integers are kept as strings.
Which array format should I use for JSON to query string?
Use brackets (a[]=1&a[]=2) for PHP, Rails and Express with qs; indices (a[0]=1&a[1]=2) when order or nested objects in arrays matter; repeat (a=1&a=2) for Python, Go, Java Spring and URLSearchParams; and comma (a=1,2) only when your API documents it.
Is my data sent to a server?
No. Parsing and encoding happen entirely in JavaScript in your browser, so URLs containing tokens or personal data never leave your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.