Boneyard Tools

Query String Parser

Paste the part of a URL after the question mark and read it as a clean key/value table or formatted JSON, with percent-encoding decoded and a plus sign treated as a space. Switch to the other direction to type one key=value per line and get back a properly encoded query string. Repeated keys such as two tag= values are preserved, becoming an array in the JSON view.

How to parse a query string

  1. Pick a mode with the buttons: 'Query to JSON' to decode a URL, or 'Pairs to query' to build one.
  2. In 'Query to JSON', paste a query string like tag=a&tag=b&q=hi%20there into the box; a leading question mark is fine.
  3. In 'Pairs to query', type one key=value per line instead, for example q=hello world on its own line.
  4. Read the formatted JSON or the encoded query string in the lower box.
  5. Scan the Key and Value table underneath to check each pair, then click Copy.

Examples

Repeated keys become an array (Query to JSON)

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

A flag with no value keeps an empty string

flag&sort=asc
{
  "flag": "",
  "sort": "asc"
}

Build an encoded query from typed pairs (Pairs to query)

q=hello world
tag=a
tag=b
q=hello%20world&tag=a&tag=b

Frequently asked questions

How are repeated keys handled?

In the Key and Value table each occurrence stays on its own row, so nothing is lost. In the JSON view a key that appears more than once is grouped into an array of its values in the order they were written, while a key that appears once maps to a plain string.

Does it decode percent-encoded characters?

Yes. When parsing to JSON both keys and values are percent-decoded, so %20 becomes a space and %26 becomes an ampersand. A plus sign is also converted to a space, which matches how browsers historically read form-encoded query strings.

What happens to a key that has no value?

A bare segment with no equals sign, such as flag, is parsed as that key with an empty string value. The key is preserved rather than dropped, and in the table its value column simply reads as empty.

Can I include the leading question mark or a full URL?

You can include a leading question mark and it is stripped automatically, so a=1&b=2 and ?a=1&b=2 parse identically. It does not split a whole URL for you, so paste only the query portion after the question mark rather than the scheme and path.

How does the build direction encode spaces?

When you build a query from pairs, keys and values are percent-encoded and a space becomes %20 rather than a plus sign. Pairs are joined with an ampersand, and any row whose key is empty is skipped so you never emit a dangling equals sign.

What if a value itself contains an equals sign?

Only the first equals sign in a segment splits the key from the value, so a segment like token=a=b=c parses to the key token with the value a=b=c. This mirrors how servers read tokens and base64 values that contain their own equals characters.

Does it change the order of my parameters?

No. Pairs are read strictly left to right and kept in that order, both in the table and in the JSON object. Order can matter for signed URLs and some APIs, so the tool never sorts or reshuffles your parameters.

What about a malformed escape sequence?

If a value contains an invalid percent escape that cannot be decoded, the tool falls back to the plus-normalized text for that piece instead of throwing an error, so you still get a readable result rather than a crash.

Is any of this sent to a server?

No. Parsing, decoding and building all run locally in your browser, so URLs that carry tokens, ids or search terms never leave your device.

Learn more

Related tools