JSON ↔ Query String

Convert between JSON objects and URL query strings with nested keys and array formats.

q=hello%20world&tags=js&tags=ts&page=2&filter[active]=true&filter[role]=admin

About JSON ↔ Query String

JSON ↔ Query String converts between a JSON object and a URL query string in either direction. Pick a format for nested keys (bracket notation `user[name]=Ada`, dot notation `user.name=Ada`, or stringify-then-encode) and a format for arrays (repeated keys, indexed `tags[0]=`, comma-joined). The encoder and decoder are mirror images: encode a JSON object to get the query string a server expects, or decode a query string from a log entry to read it as JSON.

Reach for it whenever a URL crosses the boundary between code that wants a structured object and a wire format that demands a flat key=value string: building search-engine query URLs from a filter UI, debugging a redirect with a long query string, replaying a request from a server log, or authoring a deep-link URL by hand. URL Encoder percent-encodes a single value; this tool builds the entire query string structure on top of that, with proper handling of nested objects and arrays.

Examples

Input
{"user": {"name": "Ada"}, "tags": ["math", "code"]}
Output
user[name]=Ada&tags[]=math&tags[]=code

Bracket notation for nested keys; repeated bracketed key for arrays. Switch the array format to indexed (`tags[0]=`, `tags[1]=`) or comma-joined (`tags=math,code`) per the consumer's convention.

Frequently asked questions

How is this different from URL Encoder?

URL Encoder percent-encodes a single value (one key, one value, one piece of text). This tool builds the entire query string structure — multiple keys, nested objects, arrays — on top of URL Encoder's primitive. Use URL Encoder for one value; use this when the input is a whole object.

Why are there multiple array formats?

Because servers disagree. PHP and Rails default to `tags[]=a&tags[]=b`. Most JavaScript-server frameworks accept that and also `tags[0]=a&tags[1]=b` (indexed). Some APIs use `tags=a,b` (comma-joined). The right choice is whatever the consumer accepts.

Are values URL-encoded?

Yes by default — every key and value is percent-encoded so the result is a valid URL fragment. Toggle the option off if you are pasting into something that does its own encoding (rare).

Does it round-trip cleanly?

JSON → query string → JSON returns the original object as long as the array format is consistent on both sides. Round-tripping a query string with mixed array formats (some indexed, some bracketed) requires you to pick one decoding format and accept the other will be misread.