Query String ↔ JSON.
Convert URL query strings to JSON (nested brackets, arrays) and JSON objects back to query strings.
Runs in your browserAbout Query String ↔ JSON
Query String ↔ JSON converts application/x-www-form-urlencoded data, the part of a URL after the question mark or the body of a classic HTML form post, into structured JSON, and builds a query string from a JSON object. Paste a whole URL or just the query. Keys with brackets are expanded the way PHP, Rails and the qs library do it: filter[brand]=Nike becomes {"filter": {"brand": "Nike"}}, size[]=42&size[]=43 becomes an array, and repeated plain keys such as page=2&page=3 are collected into an array instead of silently keeping only one. Percent-escapes and + signs are decoded, and the original key order is preserved. Turn on type conversion to turn numbers, true, false and null into JSON types; leave it off when values such as zip codes or IDs with leading zeros must stay strings. In the other direction, nested objects become bracket keys and arrays are written in the format your backend expects: brackets (tags[]=a, PHP and Rails), indices (tags[0]=a), repeat (tags=a&tags=b, as used by URLSearchParams, Go and many Java frameworks) or comma (tags=a,b). Spaces become + or %20. Common pitfalls: an unencoded & or # inside a value splits or truncates the query, sparse indices such as a[5]=x are compacted into a normal array, and different frameworks treat a key without "=" differently; here it becomes an empty string. Null values are written as key= with an empty value. Conversion happens in your browser.
How to Use
- Paste a URL or query string, or a JSON object, and pick the direction.
- Choose whether brackets mean nesting and whether to convert value types.
- For JSON → query, choose the array format and space encoding, then copy the result.
Frequently Asked Questions
Which array format should I use?
PHP and Rails read tags[]=a&tags[]=b (brackets). URLSearchParams, Go and Spring read repeated keys (repeat). Some APIs expect tags=a,b (comma). Indices (tags[0]=a) are understood by PHP, qs and Rails as well.
Why are my numbers strings?
Query strings have no types; everything is text. Turn on "Convert numbers, true/false and null" if you want JSON numbers and booleans. Long numbers and values with leading zeros stay strings.
What happens to a key without a value?
A bare key like ?debug becomes "debug": "". When building a query, null becomes debug= with an empty value.
Is my data sent anywhere?
No. Conversion runs entirely in your browser.
Related Tools
Split a URL into scheme, credentials, host, port, path, query parameters and fragment, and normalize it.
Encode and decode URL components.
Build UTM-tagged URLs or analyze existing ones.
Pretty print, minify, and validate JSON.
Convert PHP serialize() strings to JSON and JSON back to serialized PHP, objects and enums included.
Encode and decode Base64 strings.