What is JSON to Query String Converter?
JSON (JavaScript Object Notation) is a structured data format used for API requests and configuration, while URL query strings encode parameters in the format key=value&key2=value2 appended to URLs. This tool converts between the two: flatten JSON objects into URL-encoded query strings with bracket notation for nested structures, or parse query strings back into nested JSON objects.
How to Use
- Choose the conversion direction using the toggle button (JSON → Query String or Query String → JSON)
- For JSON → Query String, select your preferred array notation style and whether to sort keys
- Paste your JSON object or query string in the input area
- Click 'Convert' to generate the output
Why Use This Tool?
Tips & Best Practices
- Nested objects use bracket notation: {"user": {"name": "John"}} → user[name]=John
- Arrays can use different styles: tags[]=a (Rails), tags[0]=a (PHP), or tags=a (Repeat)
- All values are URL-encoded automatically: spaces become %20, @ becomes %40, etc.
- You can paste a full URL and the tool will extract the query string portion
Frequently Asked Questions
How are nested objects converted to query strings?
Nested objects use bracket notation. For example, {"user": {"name": "John"}} becomes user[name]=John. This is the standard format used by most web frameworks like Rails, Express, and PHP for parsing nested query parameters.
How are arrays handled in the query string?
Arrays can be represented using different bracket notation styles. The Rails style uses empty brackets (tags[]=a&tags[]=b), PHP style uses indexed brackets (tags[0]=a&tags[1]=b), and repeat style repeats the key (tags=a&tags=b). You can choose your preferred style.
Can I convert a query string back to JSON?
Yes. Use the direction toggle to switch to Query String → JSON mode. The tool parses URL parameters, reconstructs nested objects from bracket notation, and auto-detects number, boolean, and null values.
Is URL encoding applied?
Yes. All keys and values are encoded using encodeURIComponent when converting to query strings. When parsing query strings back to JSON, values are automatically decoded. This ensures special characters like spaces, ampersands, and non-ASCII characters are handled correctly.
Is my data secure?
Yes. All processing happens entirely in your browser. Your JSON and query string data is never sent to any server. No data is collected, stored, or transmitted.