{ } JSON Workbench0 network requests. Check DevTools

"Query String to JSON":{ }

Paste a URL query string (with or without the leading ?) and get a clean JSON object. Percent-encoding is decoded, numbers and booleans are restored to their types, and repeated keys become arrays. Runs 100% in your browser: zero network requests.

What is query string to JSON?

This tool parses a URL query string (the ?key=value&key2=value2 portion of a URL) into a clean JSON object. It's useful when debugging an API call, inspecting tracking parameters, or turning a GET request's parameters into a request body. It decodes percent-encoding, collapses repeated keys into arrays, and restores numbers and booleans to their real types. For the reverse direction, use JSON to Query String.

Parsing notes

  • A leading ? or # is stripped, so you can paste a full URL's query or hash.
  • + and %20 both decode to a space.
  • Values are coerced with JSON.parse when valid, otherwise kept as strings.
  • Duplicate keys become an array, preserving order.

How to use

  1. Paste a URL query string into the Input pane, with or without the leading ?.
  2. The parsed JSON object appears instantly in the Output pane, pretty-printed.
  3. Percent-encoding is decoded; numbers and booleans are restored to their JSON types where possible.
  4. Repeated keys (tags=a&tags=b) collapse into an array.
  5. Runs 100% in your browser; nothing is uploaded.

Examples

Query string → JSON

Input
page=2&limit=50&q=json+tools
Output
{
  "page": 2,
  "limit": 50,
  "q": "json tools"
}

Repeated keys become an array

Input
id=7&tags=a&tags=b
Output
{
  "id": 7,
  "tags": [
    "a",
    "b"
  ]
}

Percent-encoding decoded; a full URL's query works too

Input
?redirect=https%3A%2F%2Fx.com&active=true
Output
{
  "redirect": "https://x.com",
  "active": true
}

FAQ

How do I convert a URL query string to JSON?

Paste the query string (the part after ?) into the input. Each key=value pair becomes a property; percent-encoding is decoded and the result is pretty-printed JSON. A leading ? or # is ignored, so you can paste it straight from the address bar.

Are values typed or left as strings?

The tool tries JSON.parse on each value, so page=2 becomes the number 2, active=true becomes the boolean true, and a JSON-encoded value becomes a nested object. Anything that isn't valid JSON stays a string.

What about repeated keys?

Query strings can repeat a key (tags=a&tags=b). Those collapse into an array: {"tags":["a","b"]}.

Numeric strings become numbers. Is that a problem?

Query strings are untyped, so a value like zip=90210 is ambiguous and is restored as a number. If you need it to stay a string, quote it in the source (zip=%2290210%22). This is an inherent limitation of query strings, not a bug.

Is my data uploaded?

No. Parsing uses the browser's built-in URL decoder. Zero network requests; verify in DevTools.

Related tools