JSON to Query String
Turn a nested JSON object into a URL query string with bracket notation, such as a[b]=1&list[0]=x, fully encoded.
What converting JSON to a query string does
Every leaf becomes one pair. Objects extend the key with brackets, arrays add their index, and scalars are written as text: a boolean becomes true or false, a number keeps its digits, and null becomes an empty value. Keys and values are percent-encoded, except that brackets in a key stay readable, because every server that parses a[b] also parses the encoded form. The result is a query string, not a full URL; add the scheme, host and path yourself.
How to use it
JSON to Query String: paste the JSON into the box above, and press Run to get the query string below.
Worked example
Input:
{
"q": "ada lovelace",
"page": 2,
"filter": { "active": true },
"tags": ["math", "engine"]
}
Output:
q=ada%20lovelace&page=2&filter[active]=true&tags[0]=math&tags[1]=engine
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads JSON and returns query string; reloading the page discards both.
Every leaf becomes one pair. Objects extend the key with brackets, arrays add their index, and scalars are written as text: a boolean becomes true or false, a number keeps its digits, and null becomes an empty value. Keys and values are percent-encoded, except that brackets in a key stay readable, because every server that parses a[b] also parses the encoded form. The result is a query string, not a full URL; add the scheme, host and path yourself.
Turn a nested JSON object into a URL query string with bracket notation, such as a[b]=1&list[0]=x, fully encoded.
How to use it
JSON to Query String: paste the JSON into the box above, and press Run to get the query string below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads JSON and returns query string; reloading the page discards both.
What to Expect
Best for
- Converting JSON to query string when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
{ "q": "ada lovelace", "page": 2, "filter": { "active": true }, "tags": ["math", "engine"] }
Sample output
q=ada%20lovelace&page=2&filter[active]=true&tags[0]=math&tags[1]=engine
Frequently asked questions
How do I use the json to query string?
JSON to Query String: paste the JSON into the box above, and press Run to get the query string below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.