ネットワーク/HTTP
Query String ↔ JSON
URLのクエリ文字列をJSONオブジェクトに分解する、またはJSONをクエリ文字列に組み立て直します。
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).
よくある質問
このツールは?tag=a&tag=bのような繰り返しパラメータ名をどう扱いますか?
繰り返しのキーは通常、互いを上書きするのではなく配列にまとめられます(tag: ["a", "b"])。これはほとんどのバックエンドフレームワークがクエリ文字列を解析する方法と一致しています。
変換時に特殊文字はどうなりますか?
パーセントエンコードされた文字(スペースの%20など)は、JSONに変換する際にリテラル形式にデコードされ、JSONをクエリ文字列に戻す際に再びエンコードされます。
この変換を行うために、URLやデータがどこかに送信されますか?
いいえ。変換はブラウザ内で完全に行われます — サーバーには何も送信されません。
URLの安全な最大長はどれくらいですか?
約2000文字です — 主要なブラウザやサーバーの間で最も慎重に見積もった共通の上限です。より大きなデータ量には、クエリ文字列の代わりにボディ付きのPOSTリクエストを使う方が適しています。
クエリ文字列でtrue/falseの値や数値を渡すにはどうすればよいですか?
クエリ文字列は常にテキストしか保持できません — 「false」や「42」のような値は、サーバーやクライアントのコードが明示的に認識してbooleanや数値に変換するまで文字列のままです。