Skip to content
ZeroServer.tools

Query String to JSON Converter

Parse a URL query string into a JSON object.

JSON

Parsing query strings

This tool reads the parameters after the ? in a URL — or a bare query string — and turns them into a tidy JSON object, decoding any percent-encoded characters along the way. Repeated keys (like tags=new&tags=sale) collapse into an array, so nothing is lost. Paste a full link and the domain and fragment are ignored automatically. Parsing happens entirely in your browser.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Turning a long URL's parameters into a readable object while debugging.
  • Converting a captured request's query into a JSON body for a test.
  • Checking how repeated parameters are being interpreted.
  • Extracting parameters from a logged URL for analysis.
  • Producing a structured view of a tracking URL's parameters.

Frequently Asked Questions

Can I paste a whole URL?
Yes. Everything up to and including the first `?` is dropped, and any `#fragment` is stripped, so a full address, a bare `?a=1&b=2`, or just `a=1&b=2` all work. The fragment is removed because it never reaches the server and is not part of the query.
What happens to repeated keys?
They become an array: `tag=a&tag=b` gives `{"tag": ["a", "b"]}`. There is no standard for repeated parameters — PHP wants `tag[]=a`, Rails accepts both, and some frameworks keep only the last — so the array is the lossless reading.
Is the percent-encoding decoded?
Yes, using the URL standard's own parser, so `%20` and `+` both become a space and `%26` becomes a literal ampersand. That plus-sign rule is specific to query strings: in a path segment, `+` means a plus.
Are values typed?
No — everything is a string, because a query string carries no type information. `?count=5&flag=true` gives `"5"` and `"true"` as strings, and converting them is your application's job. Anything else would be guessing.
What about nested parameters?
`user[name]=x` produces the literal key `user[name]` rather than a nested object, because the bracket convention is a framework habit, not part of any specification. Rebuild the nesting in your own code if your backend uses it.
Should a key with no value become an empty string or null?
`?flag` and `?flag=` are different in principle and treated identically by many parsers. Choosing null for the first and an empty string for the second preserves the distinction, which matters for feature flags.

Common errors and gotchas

  • Assuming repeated keys become an array, when many parsers keep only the first or the last.
  • Losing the distinction between a missing parameter and one present with an empty value.
  • Failing to decode percent-encoding, so values keep their escape sequences.
  • Treating `+` as a literal plus in a form-encoded query, where it means a space.
  • Expecting nested structure from bracket notation, which is a convention rather than a standard.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate