Query String to JSON|Query 参数转 JSON

Query String to JSON|Query 参数转 JSON

Query String to JSON Query 参数转 JSON

a=1&b=2JSON 之间互转,支持 URL 解码、重复参数数组化、空值策略与一键复制/下载。
Convert between a=1&b=2 and JSON, with URL decode, duplicate-key handling, null strategy, copy & download for API debugging.

1. 输入参数 · Input
接口调试常见痛点:
1) 浏览器复制出来的 query 可能带编码(%E4%B8%AD…)或 “+”。
2) 例如 tag=a&tag=b 是“重复 key”,很多后端会当作数组。
3) 有些参数是开关型:debug(无等号)。

Common debugging issues:
URL-encoded values, duplicate keys for arrays, and flag-like params without “=”.

小提示:你可以直接粘贴整段 URL(含 ?)或只粘贴 query 部分。You may paste a full URL (with “?”) or only the query part.

3. 使用说明 · Notes
  • 支持粘贴完整 URL · Paste full URL:
    你可以直接粘贴:https://api.example.com/path?a=1&b=2,工具会自动截取 ? 后面的 query。
    You may paste a full URL; the tool automatically uses the part after ?.
  • URL 解码与 “+” 空格 · URL decode & plus-as-space:
    浏览器/表单场景里,空格经常被编码成 +,中文与特殊字符会是 %E4%B8%AD 这种形式。建议开启“自动 URL 解码”。
    In form-style encoding, spaces are often represented as +; non-ASCII chars are percent-encoded. Keep decoding enabled.
  • 重复参数数组化 · Duplicate keys → array:
    当出现 tag=red&tag=blue,很多后端会解析为数组。勾选后输出 JSON 为 {“tag”:[“red”,”blue”]}
    If the same key appears multiple times, enabling this will aggregate values into an array.
  • 空值与开关参数 · Empty values & flags:
    a= 表示“有 key 但值为空”;debug(无等号)是“开关型参数”。你可以用“保留空值 / 允许无等号参数”控制是否保留。
    a= means empty value; debug is a flag param without “=”. Toggle to keep or ignore them.
  • JSON → Query 的结构约定 · JSON → Query conventions:
    1) 普通键值:{“a”:1}a=1
    2) 数组:默认 tag=red&tag=blue;如果勾选“[]”,则为 tag[]=red&tag[]=blue
    3) 对象(嵌套):会用点号展开,例如 {“user”:{“id”:1}}user.id=1(这是便于调试的约定,并非所有后端都默认支持)
    Arrays can be repeated keys or bracket form. Nested objects are flattened via dot notation for debugging convenience.
  • 类型转换(可选) · Type coercion (optional):
    勾选“尝试转数字/布尔”后,a=1 会变成数字 1,flag=true 会变成布尔 true。
    Enabling this tries to convert numeric/boolean-looking strings into real types in JSON.
  • 安全说明 · Safety note:
    本工具所有转换均在浏览器本地完成,不会上传数据。适合粘贴 token、签名串等敏感字段进行离线调试。
    Everything runs locally in your browser; nothing is uploaded. Safe for offline debugging with tokens/signatures.

说明:不同后端框架对 query 的数组、嵌套对象有不同约定(例如 PHP、Node、Java 各不相同)。本工具提供的是“可控的、便于调试的输出”,你可根据目标接口规范调整选项。
Note: Different backends parse arrays/nested params differently. This tool aims to give you a controllable, debug-friendly output; adjust options to match your API conventions.