JSON to Query String Converter

Paste a flat JSON object to get its URL query string.

How it is calculated

The input must be valid JSON describing one flat object, with double-quoted keys and strings. Each property becomes key=value, in the order written, and the pairs are joined with &. Both key and value go through percent-encoding in the style of RFC 3986: letters, digits and - _ . ~ stay as they are, everything else becomes %XX. A space therefore becomes %20 (not +), and accented letters become their UTF-8 bytes, for example é as %C3%A9.

Values are turned into text first: true and false become those words, null becomes an empty value, and numbers are printed in JSON form, so 9.50 becomes 9.5. Nested objects or arrays, a top-level list, an empty object or invalid JSON give no result. The leading ? is not added. The tool also reports the number of pairs and the longest key.

Worked example

Input: {"q":"red shoes & socks","page":2,"sale":true,"tag":null,"price":9.50}. The value of q has spaces and an ampersand, so it becomes red%20shoes%20%26%20socks. page is 2, sale is true, tag is null and gives an empty value, and price 9.50 becomes 9.5. The result is q=red%20shoes%20%26%20socks&page=2&sale=true&tag=&price=9.5 with 5 parameters; the longest key is price.

Try this example →

Common mistakes

  • Pasting a nested object or an array value such as {"ids":[1,2]}. The tool needs a flat object and returns nothing; you must decide yourself whether to write ids=1,2 or ids[]=1&ids[]=2, which servers read differently.
  • Using single quotes or unquoted keys, as in JavaScript. Only strict JSON with double quotes is accepted.
  • Expecting a plus sign for spaces. Spaces become %20, which is correct in a URL path and in nearly all query strings, but a server expecting form encoding may show the %20 literally in rare cases.
  • Encoding the full result a second time before adding it to a link. It is already percent-encoded, and encoding it again turns % into %25.
  • Expecting null to disappear or numbers to keep their trailing zeros. null gives an empty value (tag=), and 9.50 is shown as 9.5.

About this calculator

A URL query string is the part after the “?” that passes key-value data to a web server, formatted as key=value pairs joined by “&” with special characters percent-encoded so they survive transmission safely. This tool takes a flat JSON object — one level deep, no nested objects or arrays — and converts each property into a properly percent-encoded key=value pair, joining them into a ready-to-use query string.

The conversion is a routine step for web developers and API integrators building or debugging HTTP GET requests, constructing shareable deep links, or converting a JSON config or form-state object into URL parameters for analytics tracking, redirect URLs or webhook callbacks. It saves the manual, error-prone work of percent-encoding each value by hand and remembering which characters (spaces, ampersands, equals signs) need escaping in a query string.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The pairs come out in the order you wrote them. If you are signing a request or building cache keys, sort the keys yourself before pasting, because many signature schemes expect a fixed order. The tool also leaves off the leading question mark, so add it when you append the string to a URL. Does your API want plus signs for spaces or bracketed array names? Tell us which style you would like supported.

Popular calculators

All Calculators