BYTETOOLS

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

  1. Paste a flat JSON object into the input box, for example {"q":"blue shoes","page":2}.
  2. Click Convert. The tool validates the JSON and confirms it is a flat object before building the string.
  3. Review the output. You get something like q=blue%20shoes&page=2, with reserved characters safely encoded.
  4. Copy the query string with one click and append it to your URL after the ?.

How each value type is handled

InputOutput in the query string
String with spaces or symbolsPercent-encoded via encodeURIComponent (e.g. a b becomes a%20b)
NumberRendered as its string form (e.g. 42)
BooleanConverted to true or false
nullConverted to its string form
Array of simple valuesExpanded into repeated keys (tags=a&tags=b)
Nested objectRejected 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

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.