JSON to Query String Converter NZ
This tool converts between a JSON object and a URL query string, the encoded key-value text that carries parameters in a web address. A query string is the part of a URL after the question mark, a series of key-value pairs joined by ampersands, such as the parameters that drive a search or filter a page. Web applications constantly need to move between this flat string form and the structured objects their code works with: building a query string from an object to make a request, or parsing one back into an object to read the parameters. Doing it by hand means fiddly percent-encoding and splitting, which is exactly where mistakes creep in. This converter handles both directions. You paste a JSON object and it builds the corresponding query string, properly URL-encoding each key and value so spaces and special characters are safe, or you paste a query string and it parses it back into a formatted JSON object. The result updates as you type and runs entirely in your browser. Use it to build request parameters, to read and debug a query string, to convert between the two forms, or for web development. When converting JSON to a query string, each property becomes a key-value pair, with values encoded so that spaces become percent-twenty and other special characters are escaped, keeping the URL valid. When converting back, the pairs are split, decoded and assembled into a JSON object. The tool works best with flat objects of simple values, which is what query strings naturally represent; deeply nested objects and arrays can be encoded in several competing conventions, so for those a dedicated library matching your framework is safer. For the common case of a flat set of parameters, this gives you a correct, ready-to-use result instantly in either direction.
Best for flat objects of simple values. Encodes/decodes each key and value. Nested objects and arrays have competing conventions; use a framework library for those. Runs in your browser.
How it works
To build a query string, each property of the JSON object becomes a key-value pair, with the key and value URL-encoded so spaces and special characters are safe, joined by ampersands. To parse a query string, it is split on ampersands and equals signs, each part is decoded, and the pairs are assembled into a JSON object.
Worked example
The JSON object with name Calculate, page 2 and q tax tools becomes the query string name=Calculate&page=2&q=tax%20tools, with the space in the search term encoded as percent-twenty. Switching to the other mode and pasting that query string back rebuilds the original JSON object.
Related calculators
- URL Encode/Decode: percent encoding.
- JSON Formatter: format JSON.
- YAML to JSON: YAML conversion.
- Base64 Encoder: encode data.