What is a JSON to query string converter?
A JSON to query string converter turns a JSON object into the query string of a URL — the part after the ?. The default JSON here has a search term, a page, a tags array, and a flag, and it converts to 5 parameters in a query string 62 characters long.
APIs and links need query strings, and programs hold data as JSON. A search page takes its filters as a query string, a tracking link takes its campaign as one, and an API takes its options as one. Converting the JSON object into the string by hand means encoding every value and joining them with & — a converter does it in one paste.
This tool handles nested data with bracket notation: an array such as tags ["a", "b"] becomes tags[0]=a&tags[1]=b, and a nested object such as {"filter": {"city": "Paris"}} becomes filter[city]=Paris. That is the convention most web frameworks read, so the string this tool produces is one a server will understand.
How the conversion works
The converter flattens the object first. A top-level key such as q becomes a parameter on its own. A nested object is flattened by joining keys with brackets: filter.city becomes filter[city]. An array is flattened by index: tags["a", "b"] becomes tags[0] and tags[1]. The default object flattens to 5 parameters: q, page, tags[0], tags[1], and active.
Each key and value is then percent-encoded separately. The value "hello world" becomes "hello%20world", and the brackets in tags[0] become %5B and %5D, so the key reads tags%5B0%5D. Encoding the brackets is correct — a raw [ in a URL is not allowed — and servers decode them back to brackets when they read the query.
The pairs are joined with & in the order the keys appear in the JSON. The result is a single string with no leading ?: "q=hello%20world&page=2&tags%5B0%5D=a&tags%5B1%5D=b&active=true". Add a ? and a host in front of it and you have a complete URL.
Bracket notation, explained
Bracket notation is how nested data survives in a flat query string. A query string has no nesting — it is a list of pairs — so the nesting must be written into the keys. An object inside an object gets a key such as filter[city], and an array gets a key per index, such as tags[0].
Most web frameworks read this notation back into nested data. PHP, Ruby on Rails, and many Node frameworks parse filter[city]=Paris into the object {filter: {city: "Paris"}}, which is the round trip this converter is designed for. A server that does not understand brackets will read the keys literally, with the brackets in the name.
Arrays have two conventions: indexed, as tags[0]=a&tags[1]=b, and repeated, as tags=a&tags=b. This tool uses indexed, because it preserves the order and the positions. If your server expects the repeated form, convert here and then remove the [0] and [1] — the values are already encoded correctly.
Bracket notation is the convention for nested data, and it is what makes the conversion reversible. A nested object such as user with a name inside it becomes user[name], and an array becomes tags[0], tags[1], and so on, with the index in the brackets. That notation is the one most server frameworks understand, so a query string written that way is parsed back into the same nested structure. A converter that flattened nested data with dots instead would produce a string the server reads as flat keys, and the nesting would be lost.
A worked example: a search link
Take the default JSON: q is "hello world", page is 2, tags is ["a", "b"], and active is true. That is 5 parameters after flattening. Convert it and you get "q=hello%20world&page=2&tags%5B0%5D=a&tags%5B1%5D=b&active=true" — 62 characters, with the space encoded as %20 and the brackets encoded as %5B and %5D.
Put a URL in front of it — https://example.com/search? plus the string — and the link searches for "hello world" on page 2, with tags a and b, and the active flag set. A URL parser splits the finished link back into its parts, which is how you check the query string it produced. A builder assembles the whole link from its parts, including a query string like this one.
Try a nested object: {"filter": {"city": "Paris", "stars": 4}} becomes filter%5Bcity%5D=Paris&filter%5Bstars%5D=4. The nesting survives in the keys, and a framework on the server reads it back into the same object. Try a top-level array and the converter reports an error — the top level must be an object, because a query string needs keys.
Who uses a JSON to query string converter, and why
Frontend developers are the main users. A search page, a filtered list, or a pre-filled form needs its state in the URL, and the state lives in the app as a JSON object. Converting the object to a query string is how the state becomes a shareable link.
API developers are the second group. A GET request carries its options in the query string, and the options are built as an object in code. A converter shows the exact string the request will send, which is useful for debugging and for writing tests.
Marketers are a third group. A tracking link needs utm parameters, and the campaign data is often held as JSON in a spreadsheet or a tool. Converting it gives the query string to append to the link, with every value encoded. A URL encoder decoder decodes the values in such a string one at a time.
Front-end developers are a third group. A search page reads its filters from the query string, and the filters are held in the app as a JSON object, so the link the app builds must turn that object into a query string. The converter is the tool for testing that step: paste the object the app holds, and the query string it produces is the one the link should carry. If the app's link differs, the difference is a bug, and the converter shows what the link should be.
JSON to query string vs URL builder
A converter turns an object into a query string; a builder assembles a whole URL. The URL encoder decoder on this site encodes and decodes single values, which is the tool for one value rather than a whole string. A builder takes a protocol, a host, a path, and a list of parameters, and produces the complete link. This tool produces only the query string — the part after the ? — from a JSON object.
Use this tool when the data starts as JSON, and the builder when the data starts as separate fields. The query string this tool produces can be pasted into the builder's parameters, or appended to a URL by hand with a ? in front.
A URL parser does the reverse for a whole URL: it splits a link into its parts, including the query string. The three tools cover the whole journey of a query string — from JSON, to URL, and back to a table.
A converter is not a parser, and the distinction matters when the direction is reversed. A converter turns JSON into a query string, which is the tool for data that starts as an object. A parser turns a query string into a table, which is the tool for a string that arrived from a link. Use the converter to build the string and the parser to read one back — the two tools do opposite jobs, and the round trip through both is the test that the conversion is correct.
Common JSON to query string mistakes
The first mistake is a top-level array. A query string needs keys, so a bare array such as [1, 2, 3] has nowhere to go. Wrap it in an object with a key, such as {"items": [1, 2, 3]}, and it converts to items[0]=1&items[1]=2&items[2]=3.
Second: unencoded brackets. A query string with raw [ and ] in it is technically invalid, and some servers reject it. This tool encodes brackets as %5B and %5D, which is correct — do not decode them by hand before sending.
Third: null values. A JSON null becomes an empty value in the query string, such as flag=, which a server may read as an empty string rather than as absent. Remove keys with null values from the JSON if the server should not receive them at all.
Fourth: expecting the server to understand brackets. Not every server parses bracket notation — some read filter[city] as a literal key name. Check what your server expects before sending a nested query string, or flatten the data yourself.
A second mistake is expecting the query string to carry a value that a URL cannot. A value with a newline, a very long string, or binary data will be encoded, but the result is a URL so long that some servers and browsers will refuse it — the practical limit for a URL is around two thousand characters, and a query string pasted from a large JSON object will exceed it. The converter will still produce the string, but the link will fail. Large data belongs in the body of a request, not in the query string.
How to use this JSON to query string converter
Paste a JSON object into the box — the default has 5 parameters after flattening — and the query string appears instantly in the box below, with the parameter count and the string length above it. The status reads Valid when the input parses cleanly. A JSON formatter tidies the JSON first if it is messy.
To copy the string, use the Copy button next to the output box, then append it to a URL with a ? in front. To read a query string back, paste it into the URL parser.
Everything runs in your browser. No sign-up, no account, no data sent anywhere — your JSON never leaves your device. It works offline once the page has loaded.
Paste the JSON object and the query string appears underneath with the pair count and the string length above it. The pair count is the number of keys after flattening, which is more than the number of top-level keys when the object is nested. Check that every value you expected is in the string, then copy it and append it to a URL with a question mark in front. To check the result, paste the finished URL into the URL parser, which splits it back into its parts.