Skip to content

Query String Parser

Turn ?a=1&b=2 into a readable table and a JSON object, with percent-encoding and + signs decoded.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Query String Parser?

A query string is the part of a URL after the "?", made of name=value pairs joined by "&". Values are percent-encoded and, in HTML forms, spaces are written as "+". Reading them by eye quickly becomes painful.

Paste either a bare query string or a complete URL. The tool lists every pair in a table (name, decoded value, raw value) and builds a JSON object. Repeated names can be grouped into arrays, and the PHP-style notations tags[] and filter[color] can be expanded into arrays and nested objects.

How does it work?

  1. Paste a query string (with or without the leading "?") or a whole URL; anything after "#" is ignored.
  2. Choose whether repeated names are grouped into arrays and whether name[] and name[key] notation is expanded.
  3. Read the table of decoded pairs and copy the JSON result for your code or tests.

Common use cases

  • Reading the parameters of a long search or analytics URL copied from a browser.
  • Turning a callback query string into JSON for a unit test fixture.
  • Checking that a value survived encoding, for example a "+" that became a space.
  • Understanding how a framework will receive tags=a&tags=b compared with tags[]=a&tags[]=b.

Examples

Try this input in the tool above:

Input
https://shop.example.com/search?q=red+shoes&size=42&tag=sale&tag=new&filter[color]=red&empty=&page=2#results
Output
{
  "q": "red shoes",
  "size": "42",
  "tag": [
    "sale",
    "new"
  ],
  "filter": {
    "color": "red"
  },
  "empty": "",
  "page": "2"
}

Privacy

Query String Parser runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

There is no single official rule for repeated or bracketed names: servers and frameworks differ, so the JSON shows one common convention, not what your backend will necessarily see.

Frequently asked questions

How are "+" signs handled?

In a query string a "+" is read as a space, as HTML forms do. A literal plus must be written as %2B, and the table shows the raw value so you can tell which one you have.

What happens to a parameter with no value?

A name without "=" (like ?debug) is kept and given an empty string value, so it still appears in the table and in the JSON.

Why did filter[color]=red become a nested object?

With the bracket option on, the name is expanded the way many server frameworks do it. Untick the option to keep the name exactly as written.

More tools in Developer Tools →