Building a query string by hand from a JSON object is one of those small jobs that goes wrong in a specific and annoying way: a space that should be a plus sign or %20, an ampersand inside a value that gets read as a new parameter, or a nested object that has no obvious query string form at all. Getting all three right by typing the string manually, especially for anything with more than two or three fields, invites exactly that class of bug.
The conversion runs entirely in your browser using the same encodeURIComponent function every JavaScript environment provides, so nothing you paste or upload is sent anywhere. A payload containing an API key, a session token or other sensitive parameter values stays on your device throughout, from the JSON you start with to the query string you copy out.
When you should use a json to query string converter
Converting is useful any time a request needs its parameters attached to a URL rather than sent as a JSON body, which is exactly how a GET request works, and also how many analytics pixels, redirect links and third party APIs expect their configuration passed. If you already have the data as a JSON object from a config file, a form or another API's response, you can convert json to query string form directly rather than retyping every field by hand.
It is also useful for debugging, since seeing a JSON payload rendered as the exact query string it would become makes it far easier to spot a parameter name mismatch or a value that needs additional escaping before an API call is actually made.
- Convert to a query string when a GET request needs its parameters in the URL rather than a JSON body.
- Convert to a query string when building a tracking pixel, redirect link or webhook URL.
- Convert to a query string to debug exactly what a JSON payload will look like once URL encoded.
- Keep JSON when the same data is being sent as a POST body instead of URL parameters.
How this json object to url params conversion handles nesting
A flat JSON object converts directly: every key becomes a parameter name and every value becomes its parameter value, both percent encoded. Nesting is where a plain query string has no single agreed standard, so this tool supports the two most widely used conventions and lets you choose between them rather than picking silently on your behalf.
Bracket notation, the default, follows the convention PHP's http_build_query function and jQuery's $.param function both use: a nested object under a key called address with a city field becomes address[city]=Oslo, and an array becomes repeated empty brackets, such as tags[]=admin&tags[]=staff, one pair per item. Dot notation instead writes the same nested object as address.city=Oslo, which some APIs and frameworks, particularly ones built around Ruby or certain JavaScript libraries, expect instead.
Percent encoding and the nested query string encoding convention
Every key and every value is passed through the same percent encoding rules a browser itself applies to a URL, so a space becomes %20, an ampersand inside a value becomes %26, and an equals sign inside a value becomes %3D, all of which would otherwise be misread as query string structure rather than data. This is the exact nested query string encoding a server side framework's own query string parser expects to receive, so the output pastes directly into a URL without any further editing.
Because encoding happens automatically, values containing punctuation, non ASCII characters or other symbols that would otherwise break a hand typed query string are handled correctly without you needing to think about which characters are safe and which are not.
What happens to arrays, booleans and null values
An array under a key produces one query parameter per item, all sharing the same parameter name, which is the convention almost every backend framework's query string parser already expects and automatically collects back into a list. A boolean value is written as the literal text true or false, and a null value is written as an empty string, since a query string has no native way to represent either type directly and these are the conventions most APIs already assume on the way back in.
A deeply nested structure, such as an array of objects, combines both rules: each object in the array gets its own bracketed index or its own repeated key segment depending on the notation you chose, so even a fairly complex JSON payload converts to a query string without silently dropping any of its structure.
Building a url query string generator workflow you can trust
Because this url query string generator runs the same JavaScript encoding function your browser already uses internally, the output is guaranteed to be a string a server can decode correctly, rather than an approximation typed by hand that merely looks right. Pasting the result directly after a question mark on any base URL produces a request with exactly the parameters the source JSON described.
For a request that needs to go out immediately rather than being pasted somewhere, the encodeURIComponent function this tool wraps is available directly in application code as well, so the same encoding rules demonstrated here apply identically whether you build the query string in the browser, on a server, or by hand with this converter.
How to convert JSON to a query string
- 1
Add your JSON
Paste a JSON object into the box, or drop a .json file. Nothing leaves your device.
- 2
Choose bracket or dot notation
Pick bracket notation for the PHP and jQuery style, or dot notation for frameworks that expect a.b=c instead.
- 3
Convert
Press convert. Every key and value is percent encoded automatically as the query string is built.
- 4
Copy the result
Copy the query string and paste it after a question mark on any base URL, or use it as a request body.
Related tools worth bookmarking
Sources and further reading
- MDN: encodeURIComponentThe browser API this converter uses to percent encode every key and value in the query string.developer.mozilla.org
- RFC 3986: Uniform Resource Identifier (URI): Generic SyntaxThe specification defining which characters in a URI, including a query string, must be percent encoded.rfc-editor.org
- PHP Manual: http_build_queryThe PHP function whose bracket notation convention for nested arrays this converter's default output matches.php.net
Frequently asked questions
Common questions about the json to query string converter.
It is percent encoded like any other character in the key, so a literal square bracket typed into your JSON's own field name becomes %5B or %5D in the output rather than being confused with the bracket notation this converter generates for nested keys, keeping the two uses of brackets from colliding in the final string.
It expands a nested object into bracket notation by default, such as address[city]=Oslo, following the same convention PHP's http_build_query and jQuery's $.param functions use. A dot notation option is also available for frameworks that expect address.city=Oslo instead.
Each item in the array produces its own query parameter sharing the same name, for example tags[]=admin followed by tags[]=staff, which is the convention most backend frameworks already expect and automatically collect back into a list on the receiving end.
Yes. Every key and value passes through the same percent encoding rules a browser applies to a URL, so spaces, ampersands, equals signs and non ASCII characters are all converted to their correct percent encoded form rather than breaking the resulting query string.
No, the output is the query string alone with no leading question mark, so you can paste it directly after your own base URL, or attach it to a request body, without needing to strip a character you did not want first.
No. JSON.parse reads your payload locally, and the same encodeURIComponent function your browser already ships is what performs every bit of percent encoding, so a payload containing an API key or a session token is transformed entirely within the tab rather than being sent anywhere to be processed.