Query String Codec

Parse URL query strings into structured JSON, or build encoded query strings from JSON with repeat, bracket, index, or comma array styles. Runs entirely in your browser.

Try:
Result

About this tool

Query String Codec converts between URL query strings and structured JSON in both directions. Use it to inspect a long URL's parameters, debug form-encoded API calls, or build a query string from a JSON object without hand-escaping spaces, brackets, or unicode.

In Query string → JSON mode, the tool accepts a bare query string or one with a leading ?. It splits on & and ;, percent-decodes keys and values, decodes + as a space by default, turns repeated keys into arrays, and expands common bracket notation such as tags[], tags[0], and user[name] into nested arrays and objects.

In JSON → query string mode, paste a JSON object and choose how arrays should be serialized: tags[]=a&tags[]=b, tags[0]=a&tags[1]=b, tags=a&tags=b, or tags=a,b. You can also sort keys, use %20 instead of + for spaces, and add a leading ?.

Worked example

Input query string:

name=John+Doe&color=red&color=blue&user[age]=30

Output JSON:

{
  "name": "John Doe",
  "color": [
    "red",
    "blue"
  ],
  "user": {
    "age": "30"
  }
}

Switch to JSON → query string, paste {"tags":["a","b"]}, and choose repeat to get tags=a&tags=b or indices to get tags[0]=a&tags[1]=b.

FAQ

Does parsing a query string infer numbers and booleans?

No. Query strings carry text, so parsed values stay strings. age=30 becomes "30", not the number 30. When building from JSON, numbers and booleans are serialized to their normal text form.

Which array styles round-trip?

brackets, indices, and repeat round-trip through parse as arrays. comma is compact for APIs that expect tags=a,b, but parse intentionally leaves it as the string "a,b" because commas are valid data too.

What does “Use + for spaces” change?

With the option on (default), build mode writes spaces as + and parse mode decodes + back to a space, matching HTML form encoding. Turn it off for stricter RFC 3986 style: build writes %20, and parse keeps literal plus signs as +.

Is the query string uploaded or fetched?

No. The codec is pure WebAssembly running in your browser. It never fetches URLs; it only parses or builds the text you paste.

Limits & edge cases

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool query-string-codec 'direction=parse'

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/query-string-codec/?direction=parse&input=name%3DJohn%2BDoe%26color%3Dred%26color%3Dblue%26user%5Bage%5D%3D30&array_style=brackets&space_as_plus=true&sort_keys=true&prefix_question_mark=true

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.