JSON to Query String Converter

Turn a JSON object into a percent-encoded query string you can append to a URL.

JSON
Query string
Runs locally in your browser

About the JSON to Query String Converter

Building a query string by hand means remembering to encode spaces, ampersands and Unicode. This converter does it with the browser's own URLSearchParams encoder, so the output matches what a form submission would produce: spaces become +, reserved characters are percent-encoded, and pairs are joined with &.

Nested objects are flattened into dotted keys (filters.color=grey) and arrays into indexed keys (tags.0=a). Different servers expect different conventions for nested data, such as filters[color] in PHP and Rails; if yours needs brackets, replace the dots after conversion. Null values become empty strings.

The output has no leading question mark, so it can be appended to a URL that already has parameters. Use Query String to JSON to read parameters back out of a URL.

How to use

  1. Paste a JSON object on the left.
  2. Copy the encoded query string from the right.
  3. Append it to your URL after a ? or &.

Common questions

Why are spaces shown as + instead of %20?
That is the application/x-www-form-urlencoded convention used by browsers and understood by every server. Replace + with %20 if a specific API requires it.
How are nested objects encoded?
As dotted keys. Convert them to bracket notation by hand if your framework expects a[b]=c.
Does it encode Unicode?
Yes, as UTF-8 percent-escapes, which is what URLs require.