Rete/HTTP
Query String ↔ JSON
Scomporre una query string di URL in un oggetto JSON, oppure ricostruire un JSON in query string.
A URL's query string (the part after ?) is a flat set of key-value pairs, while JSON supports nested structures and data types. This tool converts between the two, including repeated keys and arrays.
How to use it
- Query → JSON: paste a query string (with or without the leading ?) to get a JSON object with decoded parameter values.
- JSON → Query: paste a JSON object to build a query string from it with correctly URL-encoded values.
- Repeated keys (a=1&a=2) are automatically recognized as an array in the JSON output.
Common uses
- Building query parameters from a JSON configuration object for an API request.
- Reading a complex query string with dozens of parameters in a structured, readable form.
- Debugging why a parameter isn't reaching the backend — checking its encoding and structure after conversion.
Things to keep in mind
Every value in a query string is text — "true", "false", or "42" stay strings in the JSON until code explicitly converts them to the right type.
Nested objects and arrays have no single standard query-string notation — different backend frameworks (PHP, Rails, Express) use slightly different syntax (a[b]=1 vs a.b=1).
Articolo su questo strumento: Query string contro JSON: perché i parametri GET sono così limitati
Domande frequenti
Come gestisce questo strumento nomi di parametri ripetuti come ?tag=a&tag=b?
Le chiavi ripetute vengono tipicamente raccolte in un array (tag: ["a", "b"]) invece di sovrascriversi a vicenda, corrispondendo a come la maggior parte dei framework backend analizza le query string.
Cosa succede ai caratteri speciali durante la conversione?
I caratteri codificati in percentuale (come %20 per uno spazio) vengono decodificati nella loro forma letterale quando si converte in JSON, e ricodificati quando si converte il JSON di nuovo in una query string.
Il mio URL o i miei dati vengono inviati da qualche parte per eseguire questa conversione?
No. La conversione avviene interamente nel tuo browser — nulla viene inviato a un server.
Qual è la lunghezza massima sicura per un URL?
Circa 2000 caratteri — il limite comune più prudente tra i browser e i server più diffusi. Per quantità di dati maggiori è meglio usare una richiesta POST con corpo invece di una query string.
Come si passa un valore true/false o un numero tramite una query string?
Una query string memorizza sempre solo testo — valori come "false" o "42" restano stringhe finché il codice server o client non li riconosce esplicitamente e li converte in booleano o numero.