Skip to content

Query String Parser

Split the query string of a URL into its names and values, decoded, with repeated names shown together.

Query string parser
Paste a full URL, or just the part after the question mark.

Result
5
Parameters
https://www.mystore.com/shop
Address before the ?
Names and values
#NameValue
1utm_sourcenews
2colorred
3colorblue
4qcafé au lait
5empty
As JSON
{
  "utm_source": "news",
  "color": [
    "red",
    "blue"
  ],
  "q": "café au lait",
  "empty": ""
}

Private: Everything runs in this page. Nothing you type is sent anywhere or saved.

On this page
  1. Query string examples
  2. Formula
  3. How the query string parser works
  4. What this tool does not do
  5. Frequently asked questions
  6. References
  7. Related tools

Query string examples

InputNames and values
a=1&b=2a="1", b="2"
?x=a%20b&y=c+dx="a b", y="c d"
https://x.test/p?k=1&k=2k="1", k="2"
flag&on=1flag="", on="1"
q=caf%C3%A9q="café"

Formula

query = name=value pairs joined by &; %XX is one UTF-8 byte; + means a space

How the query string parser works

  1. Step onePaste a URL or only the query string.
  2. Step twoRead the list of names and values. Percent codes such as %20 and plus signs are decoded.
  3. Step threeCopy the JSON if you need the data in code.

What this tool does not do

  • It does not fetch the URL or check that it works.
  • It splits on & only; some old systems use a semicolon, which is not split.
  • It does not know what a parameter means.

Frequently asked questions

How are repeated names shown?

Each occurrence is listed in the table in order. The JSON groups them into a list under one name.

What happens to the part after the #?

It is the fragment. It is never part of the query, so it is left out of the list.

Why is a value left as typed?

If a % is not followed by two hex digits or the bytes are not valid UTF-8, the value cannot be decoded, so it is kept as it was and the note says how many.

References