Query String to JSON
Decode a URL query string into a JSON object — repeated keys become arrays
Query String
JSON
What does Query String to JSON do?
You paste a query string on the left — with or without the leading ? — and the right side fills with a JSON object. Values are URL-decoded along the way (so customer=Ava%20Chen becomes "customer": "Ava Chen"), and if the same key appears more than once it collapses into a JSON array. That last bit is the part most ad-hoc string splits get wrong, which is why this page exists.
The parsing uses the browser's built-in URLSearchParams — the same thing that powers request.query in every modern web framework. URLSearchParams follows the application/x-www-form-urlencoded rules from the WHATWG URL Standard, which is what browsers send when a form posts. The output is then serialised via JSON.stringify per RFC 8259.
Everything runs in your browser. If your input is a full URL, the page is forgiving — it'll pull the query portion out for you. If you only want the URL components themselves (host, path, etc.), use URL to JSON instead. If you just want to look at the parameters without keeping the JSON, the URL Parser page is a better fit. The percent-encoding rules at play here are defined by RFC 3986 §2.1.
How to Convert a Query String to JSON
Three steps. Each one matches a button on this page.
Paste the Query String
Drop the query string into the left panel. Including the leading ? is fine — the parser strips it. Click Sample to load a realistic e-commerce filter URL with percent-encoded values, bracket-notation, and a repeated tag key. Sample:
?customer=Ava%20Chen&status=active&total%5Bgte%5D=49.99&page=2&tag=premium&tag=verifiedYou can also paste a full URL like <code>https://shop.example.com/orders?...</code> and the page will extract the query portion for you.
Read the JSON Object
The right panel updates as you type. Each parameter is a key, each value is decoded, and repeated keys turn into arrays. So the sample above produces "customer": "Ava Chen", "total[gte]": "49.99", and "tag": ["premium", "verified"]. Numbers stay as strings — query strings have no type information, so faking it would just hide bugs.
Copy, Download, or Minify
Click Copy to send the JSON to your clipboard, Download to save it as querystring.json, or Minify to compact it onto one line. Clear resets the input panel.
When You'd Actually Use This
Debugging request logs
Server logs dump the full request line, query string and all. When you're hunting why a customer's search returned nothing, copying ?customer=Marco%20Rivera&status=cancelled&date_from=2026-04-01&date_to=2026-04-30 from the log into this page is faster than mentally URL-decoding each value. The JSON makes the actual filter values obvious.
Generating test fixtures from real traffic
You're writing tests against an endpoint that takes 12 query parameters. Grab a real URL from production, paste the query string here, and use the JSON as the parameter object in your test. Real names, real shapes, real bugs caught — beats inventing customer: "ORD-1001" from your head.
Migrating between query-string conventions
Different stacks encode arrays differently — ?tag=red&tag=blue, ?tag[]=red&tag[]=blue, ?tag=red,blue. Converting to JSON first gives you a neutral intermediate form. From there, transforming to the target convention is a 5-line script instead of regex archaeology.
OAuth, webhooks, and analytics callbacks
OAuth callbacks come back as ?code=abc&state=xyz. Webhook URLs from services like Stripe or GitHub stuff metadata into the query string. Analytics redirects pile a dozen UTM and tracking params on top. Pasting just the query portion here gets you straight to the parameter object without having to strip the host first.
Common Questions
Do I need to include the leading question mark?
No — paste with or without it. The parser strips a leading ? if it sees one. You can even paste a full URL (https://api.shop.example.com/orders?customer=Ava%20Chen) and the page will pull the query portion out for you.
How are repeated keys handled?
They collapse into a JSON array. So ?tag=premium&tag=verified becomes "tag": ["premium", "verified"]. This matches the behaviour of URLSearchParams.getAll() and how Express, FastAPI, ASP.NET, and Spring parse query strings.
What about valueless keys like ?debug or ?dry-run?
They become empty strings — "debug": "". URLSearchParams treats a key without an = as the same as key= per the WHATWG URL Standard. If you need a true boolean, post-process the JSON with something like obj.debug = "debug" in obj.
What about bracket notation like ?items[]=1&items[]=2?
The brackets are kept as part of the key — you'll see "items[]": ["1", "2"] in the output. That's honest to the bytes on the wire. If your framework (PHP, Rails, qs.js) needs the brackets stripped or expanded into nested objects, do that as a post-processing step.
Why are all values strings, even if they look like numbers or booleans?
Because query strings carry no type information. ?count=5 and ?count=true are both just text. Auto-coercing to numbers or booleans makes things look tidy on a happy-path sample but causes silent bugs the moment a customer's name is "1" or someone writes ?id=007. The output stays as strings; convert in your code where you know the schema.
How does it handle Unicode and emoji?
Cleanly. URLSearchParams percent-decodes the bytes, then interprets them as UTF-8 — so ?name=%E4%B8%AD%E6%96%87 becomes "name": "中文" and emoji like ?reaction=%F0%9F%94%A5 become "reaction": "🔥". JSON.stringify then escapes anything that needs escaping per RFC 8259 §7.
Other URL & JSON Tools
Decoding a query string is one operation. Here's what else pairs with it: