What is JSON to Query String Converter?
URL query strings encode parameters in the format key=value&key2=value2, appended to URLs after the question mark. They are the standard way to pass parameters in HTTP GET requests, form submissions, and API calls. This tool converts bidirectionally between JSON and URL query strings, handling the complexities that arise from the mismatch between JSON's nested structure and query strings' flat key-value format. Nested JSON objects are expanded using bracket notation (user[name]=John), arrays support three different serialization styles (Rails, PHP, and repeat), and all values are properly URL-encoded using encodeURIComponent. When parsing query strings back to JSON, bracket notation is reconstructed into nested objects, and primitive types (numbers, booleans, null) are auto-detected from their string representations.
How to Use
- Choose the conversion direction using the toggle button (JSON to Query String or Query String to JSON)
- For JSON to Query String, select your preferred array notation style (Rails, PHP, or Repeat) and whether to sort keys alphabetically
- Paste your JSON object or query string in the input area
- Click 'Convert' to generate the output
- Copy the result and use it in your API calls, browser bookmarks, or configuration files
Why Use This Tool?
Tips & Best Practices
- Nested objects use bracket notation: {"user": {"name": "John"}} becomes user[name]=John
- Arrays can use different styles: tags[]=a (Rails), tags[0]=a (PHP), or tags=a (Repeat) — choose the one your backend expects
- 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 automatically
- Enable 'Sort keys' for deterministic output, which is useful for caching and URL comparison
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.
When should I not use this converter?
Avoid this tool when your JSON contains deeply nested structures (more than 3-4 levels), as the resulting bracket notation becomes unwieldy and some servers limit URL length. Also avoid it for binary data or Base64-encoded content — use request bodies instead. Query strings are best suited for simple filter, sort, and pagination 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). Choose the style that your backend framework expects.
Can I convert a query string back to JSON?
Yes. Use the direction toggle to switch to Query String to JSON mode. The tool parses URL parameters, reconstructs nested objects from bracket notation, and auto-detects number, boolean, and null values from their string representations.
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. You can safely convert parameters containing API keys, session tokens, or other sensitive values.
Real-world Examples
Building API filter parameters from a JSON structure
When constructing API calls with complex filter parameters, define your filters as a JSON object and convert them to a query string. This is especially useful for nested filters where bracket notation is required by the API.
{
"filter": {
"status": "active",
"category": "electronics"
},
"page": 1,
"limit": 20,
"sort": "created_at",
"order": "desc"
}filter[status]=active&filter[category]=electronics&page=1&limit=20&sort=created_at&order=desc
Parsing and debugging URL parameters from a production URL
When debugging API calls or analyzing web traffic, paste a URL or query string to convert it into readable JSON. The tool extracts the query portion, decodes URL-encoded values, and reconstructs the nested structure for easy inspection.
tags[]=new&tags[]=sale&tags[]=featured&user[name]=John%20Doe&user[email]=john%40example.com&search=wireless%20headphones
{
"tags": [
"new",
"sale",
"featured"
],
"user": {
"name": "John Doe",
"email": "[email protected]"
},
"search": "wireless headphones"
}