Skip to content
ZeroServer.tools

JSON to Query String Converter

Turn a flat JSON object into a URL query string.

or drop a file here
Query string

Building query strings from JSON

A query string passes key/value data in a URL after the ?. This tool flattens a JSON object into one, URL-encoding every key and value so spaces and symbols are safe. Array values are repeated as multiple parameters (e.g. tags=new&tags=sale), and booleans/numbers are stringified. It's handy for assembling UTM links and API requests. Everything is encoded locally in your browser.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Turning an object into the query string a GET endpoint expects.
  • Building a URL by hand for a curl command from a structured payload.
  • Converting a request body into parameters when moving from POST to GET.
  • Producing a tracking URL from a set of parameters.
  • Checking how your values will look once encoded.

Frequently Asked Questions

How are nested objects handled?
A query string is flat — it has no nesting — so a nested object has to be encoded by convention. Flatten your data before converting, or send it as a JSON body instead. Any bracket or dot syntax is a framework habit rather than a standard.
What gets percent-encoded?
Everything outside the unreserved set: `&`, `=`, `?`, `#`, `/`, `+`, spaces and every non-ASCII character. Spaces become `%20`. Missing the `&` and `=` encoding is what lets one value's content silently create a new parameter.
Is there a length limit?
Not in the spec, but there is in practice. Browsers stop around 2,000 characters reliably, and servers impose their own limits — nginx defaults to 8 KB for the whole request line. Past a few hundred characters, use POST with a body.
How are arrays encoded?
As a repeated key: `tag=a&tag=b`. Every server framework accepts that form, whereas `tag[]=a` is PHP-flavoured and `tag=a,b` requires the receiver to know to split it. Repetition is the only version that is universally understood.
Are numbers and booleans preserved?
No — everything becomes text, because a query string has no types. `{"count": 5}` and `{"count": "5"}` produce identical output, and the receiver has to coerce. That asymmetry is why the conversion back is never quite lossless.
Which array encoding should I use?
It depends on the server. `a=1&a=2` is the widest-supported, `a[]=1&a[]=2` is PHP's convention, and `a=1,2` is common in APIs. None is standard, so the receiver's parser decides — guessing is how arrays arrive as a single string.

Common errors and gotchas

  • Not encoding values, so an ampersand or a space in a value breaks the whole string.
  • Assuming nested objects have a standard representation, since bracket notation is a convention rather than a rule.
  • Producing a URL longer than a server or a proxy will accept.
  • Putting sensitive values in a query string, which is logged, cached and sent as a referrer.
  • Losing type information, since every query value arrives as a string at the other end.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate