Toolstia / Query string to JSON converter

Query string to JSON converter

Paste a full URL or just the part after the question mark and get the parameters as JSON. You can also go the other way and build a query string from a JSON object.

Plus signs and percent codes are decoded. A key that appears more than once becomes a list. When you go from JSON to a query string, lists repeat the key and nested objects use brackets, such as a[b]=1. A full URL works too: only the part after the question mark and before the hash is used.

How it works

  1. Choose the direction.
  2. Paste the query string, URL or JSON.
  3. Copy the result.

Decoding

Percent codes such as %20 and plus signs for spaces are decoded, and non-English text such as %C3%A9 turns back into letters.

Repeated keys

A key that appears more than once, such as size=9&size=10, becomes a list in the JSON.

Building a query

Lists repeat the key, nested objects use brackets such as filter[color]=red, and null becomes an empty value.

Full URLs

When you paste a URL, only the part between the question mark and the hash is read.

Questions

Is my URL sent anywhere?

Everything happens in your browser, and nothing you enter is sent anywhere.

Are numbers converted?

No. Query string values are text, so 5 stays "5". This avoids changing values like 007.

What about a bad percent code?

If a code cannot be decoded, the text is kept as it was instead of failing.