Query String Parser
Decode a query string and group repeated parameter values.
Your result will appear here…
How to use Query String Parser
- Paste a query string or a URL.
- Select Parse.
- Read the JSON, where repeated names appear as arrays.
Example
Input / settings:
?tag=tools&tag=privacy&page=2
Output:
{
"tag": [
"tools",
"privacy"
],
"page": "2"
}tag appeared twice, so it is an array. page appeared once and is the string 2, not a number.
When to use
- Inspect the filter and paging parameters in an API request URL.
- Decode the percent-encoded characters in a link copied from a browser.
- Check how many times a repeated parameter was sent.
Overview
Query String Parser decodes the parameters in a query string with the browser's URLSearchParams and prints them as JSON. It accepts a bare query, a query with a leading ?, or a full URL, in which case everything up to the first ? is dropped. A name that appears once becomes a string, and a name that repeats becomes an array of strings.
Supported input
query string
Output details
JSON parameters
Common mistakes
- Values are always strings. page=2 gives "2", and code that reads the result must convert numbers and booleans itself.
- A URL's fragment is not removed. For https://example.com/p?a=1&b=two%20words#frag the value of b is "two words#frag". Cut the # part off first.
- Everything before the first ? is discarded, even when you pasted no URL: x=1?y=2 returns only y. RFC 3986 allows a literal ? inside a query, so write it as %3F.
- Only & separates pairs. In a=1;b=2 the value of a is 1;b=2, and bracket names such as a[]=1&a[]=2 stay as the literal name a[] instead of becoming an array.
- The shape depends on the count: a name sent once is a string and a name sent twice is an array, so consumers have to handle both.
- Names that look like whole numbers are listed first in the JSON, so 1 and 2 come before b. That is how JavaScript objects order such keys; it does not reflect the order in the input.
Practical tips
- Remove the #fragment before you paste a full URL.
- Use URL Parser first to split a full URL into its parts, then paste only the query.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. Parsing runs locally in your browser and decoded values are shown only as text. Query strings often carry tokens or personal data; this tool does not send them anywhere, but servers and browsers that handled the original URL may already have logged it.
References
Frequently asked questions
How does Query String Parser treat a plus sign?
A plus sign is decoded as a space, so q=a+b gives "a b". Percent sequences such as %E2%9C%93 are decoded as UTF-8.
What happens to a parameter that has no value?
It is kept with an empty string, so flag and x= both give an empty value.
Are parameter names case-sensitive?
Yes. A=1&a=2 produces two separate entries named A and a.