Query String Parser / Builder

Parse a query string or full URL into key/value pairs and JSON, or build a properly encoded query string from lines of key=value or from a JSON object.

Use the tool

Why this tool exists

Query strings carry search filters, campaign tags, API parameters and OAuth state, and they get messy: repeated keys, plus signs for spaces, nested JSON in a value. Reading them in a raw URL is a chore, and building one by hand means remembering which characters to encode.

In parse mode this tool lists every pair, numbered, and gives a JSON view where repeated keys become arrays. In build mode it takes key=value lines or a JSON object and creates an encoded string, with spaces as %20 or +. Arrays turn into repeated keys, and nested objects are written as JSON text. It runs in your browser.

How to use it

  1. Choose a mode: parse or build.
  2. For parse, paste a URL or just the part after the question mark. For build, paste key=value lines or a JSON object.
  3. For build, pick whether spaces become %20 or +.
  4. Copy the pairs, the JSON or the finished query string.

Frequently asked questions

How are repeated keys handled?

When parsing, the JSON view turns repeated keys into an array in order. When building from JSON, an array value becomes repeated keys, such as tag=a&tag=b. This is the most widely understood convention.

Should spaces be %20 or +?

Both are accepted in form-encoded query strings, but only %20 is valid anywhere in a URL. Choose + when mimicking an HTML form. If unsure, keep %20.

What happens with nested objects in JSON?

Objects inside values are converted to JSON text and then encoded, since there is no universal standard for nesting in query strings. Servers using bracket syntax such as a[b]=1 need those keys written in the lines mode.

Does it decode percent-encoding when parsing?

Yes. Keys and values are decoded, and plus signs are read as spaces, as for form data. Use the URL Decode tool for a plain decode of other text.