100% local — your data never leaves your browser

Query String to JSON — Paste the Whole URL

Turn a URL query string into JSON. Paste the whole address if you like: the parameters come out as an object you can read line by line.

Instant Private Zero cookies
Indentation

Query String input

JSON output

What this tool does

A query string becomes a JSON object.

?q=json+to+yaml&page=2&tag=a&tag=b
{
  "q": "json to yaml",
  "page": "2",
  "tag": ["a", "b"]
}

+ is a space and %C3%A9 is é: the percent-encoding is decoded for you, which is usually the reason you came. A repeated key becomes an array, in the order the values appeared.

Paste the whole address

https://x.dev/search?q=ada&lang=en#results
{
  "q": "ada",
  "lang": "en"
}

Pasting a whole URL is what most people do, and the converter used to make a key out of everything in front of the query: https://x.dev/search?q. The result looked like data and was nonsense. The address before the first question mark is now dropped, and the fragment after it too — location.search never carries it either. That was a real defect, found while writing this page and fixed.

A question mark inside a value stays where it is: a=1?2 gives {"a": "1?2"}, because the mark that opens a query comes before the first =, not after it.

Everything is a string

?id=007&active=true&count=3
{
  "id": "007",
  "active": "true",
  "count": "3"
}

A query string carries text. 007 is not 7, true is not a boolean, and a converter that guessed would quietly rewrite an identifier. The typing belongs on your side, where you know that count is a number and id is a reference with its zeros.

What is left alone

  • Bracket keys. a[]=1 and o[b]=2 keep a[] and o[b] as their names. PHP and Rails read them as arrays and objects; other stacks do not, and the string itself does not say which wrote it.
  • The order of keys. They come out as they went in, first occurrence first.
  • Empty values. ?a&b= gives {"a": "", "b": ""} — a parameter with no value is present, and that is often what it means.

Private by design

Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.

Frequently asked questions

Can I paste a whole URL?
Yes, since this page was written. Before, `https://x.dev/p?a=1` gave you a key named `https://x.dev/p?a` — the address in front of the query became part of it, and the result looked like data. Everything before the first question mark is now dropped, and so is the `#fragment` after it, exactly as a browser does when it fills `location.search`.
Why is every value a string?
Because a query string has no types. `?page=2` and `?page=02` are two different strings, and the second one means something in a good many APIs — a padded reference, a version. Reading either as the number 2 would decide for you and lose the difference. Cast on your side, where you know what the parameter is.
What about `a[]=1&a[]=2`?
The key stays `a[]`, exactly as written. Brackets are a convention — PHP and Rails read them as arrays, plenty of other stacks do not — and a query string does not say which one produced it. A key repeated without brackets (`a=1&a=2`) does become an array, because that is the one thing the syntax itself makes unambiguous.

Related converters