Boneyard Tools

Query String Parser

Turn a URL query string into clean key value pairs or JSON, or build a valid encoded query string from your own pairs. Repeated keys are kept.

How to parse a query string

  1. Paste a query string such as a=1&b=2 or a full ?a=1&b=2 into the box.
  2. Choose to JSON to read the parsed pairs, or to query to encode pairs back.
  3. Copy the result.

Examples

Repeated keys become an array in JSON

tag=a&tag=b&q=hi%20there
{ "tag": ["a", "b"], "q": "hi there" }

Frequently asked questions

How are repeated keys handled?

In the pair list each key stays separate. In JSON, a key that appears more than once becomes an array of its values, in order.

Does it decode percent-encoded characters?

Yes. Keys and values are percent-decoded, and a plus sign is treated as a space, matching how browsers read query strings.

What about a key with no value?

A bare key like flag with no equals sign is parsed with an empty string value, so the key is preserved.

Can I include a leading question mark?

Yes. A leading question mark is stripped automatically, so both a=1&b=2 and ?a=1&b=2 parse the same way.

Is anything uploaded?

No. Parsing and building both run in your browser, so your data never leaves the page.

Related tools