How to Convert JSON to a URL Query String Online
To convert JSON to a URL query string online, paste a flat JSON object into ByteTools JSON to Query String, click Convert, and the tool returns a ready-to-use query string with every value percent-encoded and arrays expanded into repeated keys. Append the result to any URL after the ? and it is immediately usable in a browser, a fetch call or an API request.
This tutorial covers the exact steps, what the tool does to each value type, and why running it locally keeps your data private.
Step-by-step conversion
- Paste a flat JSON object into the input box, for example
{"q":"blue shoes","page":2}. - Click Convert. The tool validates the JSON and confirms it is a flat object before building the string.
- Review the output. You get something like
q=blue%20shoes&page=2, with reserved characters safely encoded. - Copy the query string with one click and append it to your URL after the
?.
How each value type is handled
| Input | Output in the query string |
|---|---|
| String with spaces or symbols | Percent-encoded via encodeURIComponent (e.g. a b becomes a%20b) |
| Number | Rendered as its string form (e.g. 42) |
| Boolean | Converted to true or false |
| null | Converted to its string form |
| Array of simple values | Expanded into repeated keys (tags=a&tags=b) |
| Nested object | Rejected with a clear error — query strings are flat |
Why arrays become repeated keys
When a value is an array, the converter writes the key once per element, so {"tags":["a","b"]} becomes tags=a&tags=b. This repeated-key convention is what most web servers and frameworks parse back into a list, making it the safest default for multi-value parameters like filters or selected IDs.
Handling errors
The tool parses and validates first. If your JSON is malformed, you get a clear message so you can fix the syntax. If it contains a nested object, the tool tells you — a query string has no standard way to represent an object inside a value, so you must flatten the data first. Arrays of simple values are fine; objects nested inside are not.
Why do it in the browser
Everything runs 100% locally using the native JSON parser and the browser's URL encoder. Your JSON and the resulting string are never uploaded, logged or stored, so the tool is safe even when your object contains tokens, search terms or personal details. It also works offline once loaded.
Try the JSON to Query String — free and 100% in your browser.
FAQ
Do I include the question mark in the output?
No. The tool returns just the parameter portion (key=value&key=value). You add the leading ? yourself when appending it to a URL, or & if the URL already has parameters.
What if my values contain ampersands or equals signs?
They are safely percent-encoded by encodeURIComponent, so an ampersand inside a value will not be mistaken for a parameter separator. The resulting string stays valid.
Can I convert deeply nested JSON?
Not directly — a query string is a flat format. Flatten nested objects into top-level keys (for example user.name to user_name) before converting, or the tool will report the nested object as unsupported.
Is there a length limit on the query string?
The tool imposes none, but browsers and servers do have practical URL length limits. For very large payloads, send the data in a request body instead of the URL.
Related free tools
- Query String to JSON — reverse the conversion back into an object.
- URL Encoder — percent-encode individual strings.
- JSON Formatter — clean up JSON before converting.
- JSON Sort Keys — sort object keys alphabetically.
Built by ByteVancer
ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If you need a partner to design and ship your next product, explore what ByteVancer offers.
Recommended reading
JSON to Query String: Tips and Common Pitfalls
Best practices and troubleshooting for converting JSON to query strings: encoding, array conventions, nested-object errors and edge cases.
JSON to Query String: Real Use Cases and Examples
Practical scenarios for converting JSON to query strings: API testing, shareable filter links, analytics parameters and prefilled forms.
How to Parse and Build a URL Query String Online
Learn how to parse a URL query string into editable key/value rows and rebuild an encoded one, step by step, privately in your browser.
Yes or No Generator: Real Use Cases and Examples
From beating decision paralysis to games and classrooms, see real use cases and examples for a random yes or no generator.