Developer Tools
Query String to JSON Converter
Turn a query string or full URL into JSON, with repeated keys as arrays and filter[colour]=blue as nested objects, or build a query string from a JSON object.
How to use Query String to JSON Converter
Paste a query string, a full URL or a JSON object. Parsing or building is detected from the first character, and the JSON or query string appears as you type, along with a table of every decoded parameter.
- Paste parameters or JSONPaste a=1&b=2, a whole link with ? and #, or a JSON object that you want to turn into a query string.
- Set the optionsKeep Bracket nesting for a[b]=1 and a[]=1, tick Convert numbers and true/false, and choose whether + means a space.
- Copy the JSON or queryCopy the pretty-printed JSON or the encoded query string; the table lists each parameter in its original order.
How parameters are parsed
Anything before ? is ignored and the fragment after # is shown separately, because browsers never send it to the server. The rest is split on &, and each name and value is percent-decoded as UTF-8, with + read as a space unless you untick that option. Repeated names become arrays, so tag=new&tag=sale gives tag: [new, sale]. With bracket nesting on, filter[colour]=blue becomes a filter object and ids[]=1&ids[]=2 becomes an array. A parameter without = gets an empty string, and every value stays a string unless Convert numbers and true/false is ticked, which turns page=2 into the number 2.
Building a query string from JSON
Paste a JSON object and each key and value is encoded and joined with &. Arrays use bracket notation, so {"tag":["new","sale"]} gives tag[]=new&tag[]=sale; untick bracket nesting to get tag=new&tag=sale instead. Nested objects become keys such as filter[colour]=blue, null becomes an empty value, and spaces are written as +, or as %20 if + means space is unticked. For example, {"q":"tea cups","page":2} becomes q=tea+cups&page=2, ready to append to a URL after a question mark.
Accuracy and data handling
Validate the result with your project's own tests and runtime rules before using it in production. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Are repeated parameters lost?
No. Repeated names are collected into an array in the JSON, and the table still lists every name and value in the order they appeared.
Why is the part after # missing from the JSON?
That is the fragment. Browsers keep it on the client and never send it to the server, so it is shown separately as a note rather than mixed in with the parameters.
Why are numbers shown as strings?
Query strings have no types, so values are text by default. Tick Convert numbers and true/false and page=2 becomes the number 2 and debug=true the boolean true.
More Developer Tools
Related toolsEscape text for use inside a JSON string, or unescape it back to plain text
Look up MIME types by extension, or extensions by MIME type
Generate Cache-Control headers and server config for browsers and CDNs
Escape regex special characters for JavaScript, PHP, Python, Go or grep
Translate text into binary code and binary back into readable text
Build or decode HTTP Basic authentication headers in your browser