在浏览器中将 URL 查询字符串解析为 JSON,并从 JSON 构建查询字符串。
如何使用 查询字符串
选择方向:查询转 JSON 或 JSON 转查询。
粘贴一个查询字符串(带或不带开头的 ?)或一个 JSON 对象。
复制结果,或交换以转回。
A query string converter that turns the parameters in a URL into a readable JSON object, and builds a query string back from JSON. It decodes values, and treats repeated keys as arrays in both directions.
It runs locally in your browser, so the URLs you inspect, which can contain tokens or personal data, never leave your device.
A query string is the part of a URL after the question mark, like ?q=shoes&page=2, a list of key-value pairs that pass data to a page or API. They drive search results, filters, pagination and tracking.
When a key appears more than once, such as tag=a&tag=b, it becomes an array in the JSON so no values are lost, and a JSON array expands back into repeated parameters when you build the string.
You can paste a whole URL when converting to JSON: anything before the question mark is ignored, so you do not have to trim it first. This makes it quick to inspect the parameters of a link from your address bar.
Percent-encoded values are decoded when parsing so you can read them, and encoded again when building a query string so the result is valid, which keeps spaces and special characters correct.
常见问题
出现不止一次的键,如 tag=a&tag=b,会变成 JSON 中的数组,JSON 中的数组会展开回重复的参数。
可以。转为 JSON 时,? 之前的任何内容都会被忽略,因此你可以粘贴整个 URL。
会。百分号编码的值在解析时会被解码,在构建查询字符串时会被再次编码。
嵌入此工具
将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。
<iframe src="https://monu.tools/embed/zh/query-string-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相关工具