Query String ↔ JSON Converter
Convert URL query strings and JSON objects bidirectionally.
Category: Converters
When to use?
Use it to expand a URL query string into a JSON object to inspect parameters, or to convert a JSON object into URLSearchParams form to build an API request URL.
How to use
- Choose the direction (Query String → JSON or JSON → Query String).
- Enter the data.
- Copy the result.
Input Explanation
Enter the query string from a URL (e.g. ?id=1&name=abc) or a JSON object to turn into parameters.
Calculation Basis
It uses the URLSearchParams API to decode/encode key=value& patterns into objects, applying decodeURIComponent and encodeURIComponent to safely handle special characters.
Usage Examples
- Inspect API parameters - Expand a URL query string into a JSON object to inspect.
- Build test URLs - Convert a JSON object into a URLSearchParams query string.
- Debug parameters - Expand a complex query string into JSON to see the values.
Examples
- "name=John&age=30" → {"name":"John","age":"30"}
- {"name":"John","age":30} → "name=John&age=30"
Cautions
- Malformed source data can cause parsing errors or broken output.
- A mismatched encoding standard or complex nested data may break or drop the structure.
Guides
Query string structure
A query string is key=value pairs joined by & after the ? in a URL. Repeated keys can be treated like an array.
Check URL encoding
Non-ASCII characters, spaces, and special characters need URL encoding. For values that look broken, check with the URL encode/decode tool.
FAQ
How are repeated keys handled?
When the same key appears several times, it is preserved as a JSON array.
Are non-ASCII characters encoded?
For JSON → Query String, they are auto-encoded per URLSearchParams.
Can I paste a full URL starting with ?
It recognizes the query string part after ? in the URL and converts it.
Are keys with no value handled?
Yes. A key with an empty value converts to an empty string.
Related Tools
- JSON Formatter - Beautify or minify JSON strings instantly and check for validity errors.
- YAML ↔ JSON Converter - Convert YAML and JSON data bidirectionally in the browser.
- URL Encode / Decode - Encode text into URL-safe form (%XX) or decode an encoded URL back to text.
- JSONPath Tester - Extract values from JSON data using a JSONPath expression.
- Base64 Converter - Encode text to Base64 or decode a Base64 string back to text.
- HTML Escape / Unescape - Convert HTML special characters to entities, and restore entity strings back to characters.