1001Ferramentas
🔗Converters

JSON ⇄ Query String Converter

Convert a flat JSON object to a query string (?a=1&b=2) and vice versa. Supports a[]=1&a[]=2 array style. Everything in your browser.

JSON → Query String


Query String → JSON

Convert between JSON and query string

A URL's parameters, that query string in the ?a=1&b=2 format, and a JSON object hold the same information in different clothing. You go back and forth between the two constantly in web development, and this converter translates in both directions.

Take a flat JSON object and turn it into a query string already fit for the URL, or do the opposite and parse the parameters back into an object. It even tackles arrays in the a[]=1&a[]=2 style, exactly the kind of detail that gives you a headache by hand. Good for building links, debugging requests or reading a URL's parameters.

It all runs in the browser, with nothing sent out. Paste the JSON or the query string and grab the equivalent format, ready to use.

Frequently asked questions

Does it convert JSON with an object inside an object?
Not properly. The tool expects a flat object: every key becomes one pair in the query string, and array values turn into repeated key[]=value entries. When a value happens to be another object, it gets stringified and comes out literally as [object Object], with no error and no warning. For nested structures, flatten first, using something like user.name as the key, or encode the whole block as JSON inside a single parameter.
Why does ?a=1 come back as the text "1" instead of a number?
A query string carries no types: everything in a URL is text, and the parser hands back strings rather than inventing information. The same holds for true, false and null, which return quoted. The round trip is therefore lossy, and the JSON going in may differ from the JSON coming out. One more detail: a repeated key without brackets, like a=1&a=2, also becomes an array, exactly as a[]=1&a[]=2 would.
The output froze and won't change any more. What happened?
Most likely an invalid escape sequence on the query string to JSON side. Decoding there has no error handling, so a stray % or something like %ZZ kills the function and the output box keeps the previous result, as if nothing had gone wrong. The JSON to query string direction behaves better: a syntax error gets written into the output box with the parser's own message. Either way the text stays in the browser and travels nowhere.

Related Tools