Query Params to JSON
Paste a URL or a raw query string and read it as JSON — repeated keys, percent-encoding and bracket notation included.
How to Use the Query Params to JSON Converter
- Paste a full URL, a fragment starting with ?, or a bare query string such as q=hello&page=2 into the input box.
- Leave "Group repeated keys into arrays" on so that ?tag=a&tag=b becomes one array instead of the last value silently winning.
- Keep "Decode values" on for readable text, or switch it off when you need to see the raw percent-encoded characters exactly as they travelled.
- Switch on "Expand bracket notation" if your API uses keys like filters[status]=open or tags[]=json, and they become nested objects and arrays.
- Click "Convert to JSON", check the URL breakdown table, then copy the JSON for your test, your bug report or your API client.
What Is a Query Params to JSON Converter?
A query string is the part of a URL after the question mark: a flat list of key=value pairs joined by ampersands. It is compact and easy for a browser to send, but miserable to read once it grows past a handful of parameters — a tracking link with UTM tags, a filtered search page or an OAuth redirect can easily run to three hundred characters on a single line. This tool parses that string with the browser's own URLSearchParams engine and prints it as indented JSON so every parameter sits on its own line.
Three details make the difference between a toy splitter and something you can trust while debugging. Repeated keys are real: ?a=1&a=2 is valid and means both values, so the tool groups them into an array instead of throwing one away. Percent-encoding is real: %20, + and %C3%A9 all need decoding before the value makes sense, and a broken escape is reported rather than silently swallowed. Finally, many frameworks serialise structure into the key itself, so filters[status]=open and tags[]=json can be expanded back into nested objects and arrays when you ask for it.
Working with encoded text more generally? The URL encoder and decoder handles single values in both directions. For tabular data instead of URLs, the CSV to JSON converter turns spreadsheet exports into the same kind of JSON, and the JSON formatter tidies whatever you end up with.
Frequently Asked Questions (FAQ)
How do I convert a URL query string to JSON?
Paste the URL or the query string into the box above and click "Convert to JSON". Parsing happens in your browser using URLSearchParams, so the result matches exactly what a server or a fetch() call would see.
What happens to repeated parameters like ?a=1&a=2?
With "Group repeated keys into arrays" enabled you get {"a":["1","2"]}, which preserves both values. Switch the option off and the last occurrence wins, mirroring how some frameworks read a single value.
Can I paste a whole URL instead of just the query string?
Yes. If the input parses as a URL, only its search part is converted and a breakdown table shows the protocol, host, port, path and hash. A bare query string works too, with or without a leading ? or #.
How do I turn bracket notation like a[b]=1 into nested JSON?
Switch on "Expand bracket notation". Then a[b]=1 becomes {"a":{"b":"1"}}, a[]=1&a[]=2 becomes {"a":["1","2"]}, and deeper keys such as user[langs][] nest as far as you need.
Should I leave value decoding switched on?
Usually yes, because %20 becomes a space and %C3%A9 becomes é, which is what the application actually received. Turn it off when you are hunting a double-encoding bug and need to see the literal characters that were transmitted.
What does the "broken percent-escape" error mean?
It means a % is not followed by two valid hex digits — a truncated %E2 is the classic case, often caused by a URL being cut short. Repair the string, or disable decoding to inspect the raw pairs as they are.
Does it work with hash fragments like #access_token=abc?
Yes. When the input is not a full URL, a leading # is stripped and the remainder is parsed as a query string, which is how implicit-flow OAuth tokens and single-page-app routes carry their parameters.
Is the URL I paste sent anywhere?
No. Everything runs client-side in JavaScript and nothing is logged or uploaded. That matters here, because query strings frequently contain session identifiers, signed links and access tokens.
Tips for Parsing Query Strings
- Tip 1: Convert twice — once with decoding on and once with it off. If the two results differ by more than escapes, something in your stack is encoding the value a second time.
- Tip 2: Bracket expansion matches how Rails, PHP and qs serialise nested forms, so it is the fastest way to see what an API really received from a filter panel.
- Tip 3: The parameter count under the output is a quick sanity check: if it is lower than you expected, a stray & or an unencoded value is swallowing pairs.
- Tip 4: Keep two neighbours handy: the URL encoder and decoder for fixing one broken value, and the CSV to JSON converter when the same data arrives as a spreadsheet export instead of a link.