Query String to JSON
Turn a URL query string into a JSON object. Paste a full URL or just the part after the question mark, and every parameter is percent-decoded, plus signs become spaces and repeated keys become arrays. Bracket notation such as filter[status]=open or tags[]=a is turned into nested objects and arrays.
Frequently asked questions
Can I paste a whole URL?
Yes. Everything before the question mark and the #fragment at the end are ignored, so only the query parameters are converted. You can also paste the query alone, with or without the leading question mark.
What happens to repeated parameters?
A key that appears more than once, such as id=1&id=2, becomes an array of its values in order: {"id": ["1", "2"]}.
How is bracket notation handled?
With nested keys on, user[name]=Ada becomes {"user": {"name": "Ada"}}, tags[]=a&tags[]=b becomes an array, and keys numbered 0, 1, 2 and so on become an array too. This is the convention PHP, Rails and the qs library use. Turn it off to keep keys as written.
Why are all values strings?
A query string has no types: 42, true and hello are all text. The tool keeps them as strings so nothing is guessed. Convert them in your code where you know the expected types.
How are plus signs and percent codes decoded?
A plus sign becomes a space, as in HTML form submissions, and percent codes such as %20 or %C3%A9 are decoded as UTF-8. A malformed percent code is kept as written.
What does a key without a value become?
A parameter such as ?debug without an equals sign becomes an empty string, {"debug": ""}, which is how browsers and most frameworks read it.