Skip to content

JSON to Query String

Build a URL query string from a JSON object. Every value is percent-encoded, nested objects use bracket notation such as filter[status]=open, and arrays are written as repeated keys, with brackets, with indices or as comma separated lists. Choose %20 or + for spaces to match the server that reads the URL.

Reset

Frequently asked questions

Which array formats are available?

Repeat writes ids=1&ids=2, brackets writes ids[]=1&ids[]=2, indices writes ids[0]=1&ids[1]=2 and comma writes ids=1,2. Repeat is what URLSearchParams and most HTTP clients send; PHP and Rails expect brackets or indices.

How are nested objects written?

With bracket notation: {"filter": {"status": "open"}} becomes filter[status]=open. Deeper objects add more brackets, such as a[b][c]=1.

Should spaces be %20 or +?

Both mean a space in a query string. %20 is correct in any part of a URL, while + is what HTML forms send. Most servers accept both, so choose the one your server or API documentation uses.

Why are brackets encoded as %5B and %5D?

Square brackets are reserved characters in URLs, so they are percent-encoded by default, as PHP's http_build_query and the qs library do. Turn on readable brackets to keep them as [ and ], which most servers accept as well.

Which characters are left unencoded?

Letters, digits and the characters - _ . ! ~ * ' ( ) are left as they are. Everything else, including &, =, # and non-ASCII letters, is percent-encoded as UTF-8.

How are null and booleans written?

true, false and numbers are written as text, for example active=true. null becomes an empty value, such as note=.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.