Query String Parser

Paste a URL query string to parse it into pairs.

How it is calculated

Paste only the part of the URL after the question mark; a single leading ? is removed for you. The tool then follows the WHATWG URL Standard's application/x-www-form-urlencoded parser, the one behind URLSearchParams: the text is split at every & into pairs (a ; does not separate pairs and stays in the value), and empty pieces are skipped. Each pair is split at its first =: the left side is the key and the rest is the value, so c=x=y gives key c and value x=y. Both parts are decoded: + becomes a space, %20-style codes become the matching bytes, and bytes that are not valid UTF-8 are shown as the replacement character �. A pair with no = is kept as a key with an empty value. The output lists one key = value line per pair, the number of pairs, and Yes or No for duplicate key names. The tool does not strip a full URL or a #fragment, and it does not merge repeated keys. Names like a[] repeated twice count as duplicates.

Worked example

Paste ?utm_source=email&q=red%20shoes+size%2042&page=2&page=3&flag. After the leading question mark is removed, the tool finds 5 params. The lines are: utm_source = email; q = red shoes size 42 (the %20 and the + both became spaces, and in size%2042 the code %20 is the space before the plain digits 42); page = 2; page = 3; and flag = with an empty value. Duplicates: Yes, because page appears twice.

Try this example →

Common mistakes

  • Pasting a whole URL such as https://site.com/p?a=1. The tool only removes a leading ?, so the address becomes part of the first key. Paste from the question mark onward.
  • Leaving a #fragment at the end. It is not removed and becomes part of the last value.
  • Expecting ; to separate pairs, as some old server frameworks allowed. Browsers and URLSearchParams split only at &, so a=1;b=2 is one pair with the value 1;b=2.
  • Assuming a duplicate warning means an error. Repeated keys are valid and often intended, for example with checkboxes; they just need handling in your code.
  • Expecting a plus sign to stay a plus. In a query string it is decoded as a space, so a real plus must be sent as %2B.
  • Expecting nested data such as a[b]=1 to be turned into an object. The key is shown as the literal text a[b].

Sources

About this calculator

A URL's query string — everything after the “?” — carries key/value pairs separated by “&”, such as ?utm_source=email&page=2, and each value may be URL-encoded (spaces as %20 or +, special characters as percent-escapes) so it survives being embedded in a link. Parsing it means decoding those pairs back into readable key/value data. This tool parses the way browsers do, by the WHATWG URL Standard (the rules behind URLSearchParams): pairs are split at “&” only, so a “;” stays part of the value.

Web developers use a parser like this constantly for debugging API requests, inspecting marketing UTM parameters, or checking what data a form actually submitted, and it also surfaces a common bug source: duplicate parameter names, which different frameworks handle inconsistently (keeping the first, the last, or turning it into an array). This tool parses a pasted query string into decoded key/value pairs and flags any duplicates it finds.

Was this helpful?

You can pick up to 3 reactions.

Note from the editors

Watch the plus sign. In q=a+b%2Bc the plain plus becomes a space while the encoded one stays a literal plus, so the tool shows q = a b+c. That difference is a common source of broken search links and signature checks. Names like a[]=1 and a[]=2 are flagged as duplicates here even though many frameworks treat them as one list. Which odd query strings have you had trouble with?

Comments

  • Be the first to comment.

Popular calculators

All Calculators