UTILITIES WORKSPACE
Query String ↔ JSON
Convert query parameters to JSON strings and arrays, or build a query string.
Input is processed on this site only when you run the tool. The application does not save inputs or results.
input.txt
Result result.json
A little clarity goes here.
Run the tool to see your result.
Result preview
UTF-8 text, at most 16384 bytes per input. Tab leaves the editor. Plain text disables syntax colors. Browser textareas may normalize line endings to LF.
{"to-json":{"inputMode":"text","options":{"mode":{"type":"enum","values":["form","component"],"default":"form"}},"inputLabels":{"input":"Query string"},"outputFormat":"json"},"to-query":{"inputMode":"text","options":{"mode":{"type":"enum","values":["form","component"],"default":"form"}},"inputLabels":{"input":"JSON object"},"outputFormat":"text"}}{"to-json":{"input":"q=hello+world&tag=php&tag=json&empty=","options":{"mode":"form"}},"to-query":{"input":"{\"q\":\"hello world\",\"tag\":[\"php\",\"json\"],\"empty\":\"\"}","options":{"mode":"form"}}}A QUICK WALKTHROUGH
A familiar workflow,
with room to focus.
Choose Query → JSON or JSON → Query. Paste a bare query (optional leading ?) or a flat JSON object.
Select form mode when + means a space, or component mode to keep a literal +. Run Convert explicitly.
Review repeated values and any normalization warning before copying the result. No address is visited.
When to use Query String ↔ JSON
Move flat request parameters between a query string and readable JSON, including repeated parameter names.
Read the result
Strings remain strings and repeated names become arrays. Grouping discards parameter interleaving and bare-flag spelling; choose form or component encoding deliberately when rebuilding.
SEE IT IN PRACTICE
Worked examples
Sample input. A result you can inspect.
To Json example
Query string
q=hello+world&tag=php&tag=json&empty=
- URL mode
- Form / query
Expected result
{
"q": "hello world",
"tag": ["php","json"],
"empty": ""
}To Query example
JSON object
{"q":"hello world","tag":["php","json"],"empty":""}- URL mode
- Form / query
Expected result
q=hello+world&tag=php&tag=json&empty=
Formats, limits and common errors
Use a query rather than a full URL. For JSON → Query, quote all values and remove nested objects, empty arrays and duplicate keys.
- At most 16 KiB input and 200 parameter pairs. Split at & and the first =, then decode once. Empty input maps to {}; a leading ? is optional. Full URLs and empty segments such as && are rejected.
- JSON values stay strings; repeated names become arrays. Names with dots or brackets are literal, including empty names. Malformed percent escapes and decoded non-UTF-8 bytes are rejected.
- Grouped JSON loses interleaving and spelling. Bare flags become empty strings; rebuilding emits name=. Arrays of one value may become a string on the return trip. This is not a byte-preserving round trip.
- Reverse conversion accepts a unique-key object of strings or nonempty arrays of strings. No nested objects, empty arrays, nulls, automatic type conversion or PHP bracket expansion.
- The URI fragment is not a query parameter. Paste only the query part, without a #fragment.
- Input ceiling: 16,384 UTF-8 bytes; individual fields may have narrower limits shown above. Output: at most 131,072 UTF-8 bytes; serialized responses have a separate 1 MiB ceiling. Size/work failures return no partial result.