工具大全 ToolBox — 免费在线工具箱
提供 JSON / YAML / JavaScript 格式化、Base64 与 URL 编解码、DNS / WHOIS 查询、哈希加密、视频音频处理、AI 助手等百余款实用工具。全部在浏览器本地运行,无需安装,数据不上传服务器。
i关于本工具
用途说明
JSONPath 在线调试面向接口联调与配置抽取:在本地 JSON 文档上执行 JSONPath 表达式,支持递归下降、切片、过滤器,以及「输出值 / 输出路径」两种结果。粘贴的业务数据不会上传到本站服务器。
使用步骤
- 粘贴或导入 JSON 文档(可用示例数据)。
- 选择预设或编写 JSONPath,如 $.store.book[*].author。
- 切换输出值或输出路径,查看匹配结果。
- 复制结果到代码、测试用例或文档。
常见问题
和正则有什么不同?
JSONPath 面向结构化 JSON 的路径查询;正则面向纯文本匹配。联调接口字段、抽取数组元素时优先用 JSONPath。
会上传我的 JSON 吗?
不会。解析与求值均在浏览器本地完成。
支持哪些语法?
支持 $、@、..、[*]、[n]、[start:end]、[?(…)] 过滤等常见 JSONPath Plus 语法,体验接近 jsonpath.com。
如何给条件加「断言 / 过滤」?
用过滤器 [?(…)],当前节点用 @。例如 $.store.book[?(@.price < 10)] 选出价格小于 10 的书;$.store.book[?(@.category=="fiction")] 按字符串相等过滤;也可组合 && / ||,如 [?(@.price<10 && @.isbn)]。
List / 数组怎么取、怎么判断?
[*] 取全部元素;[0]、[-1] 取下标;[:2]、[1:3] 切片。要「数组里是否存在满足条件的项」,写过滤后看结果是否非空,如 $.items[?(@.status=="ok")];取列表某个字段写成 $.items[*].id。空数组匹配结果通常为空列表。
怎么判断字段是否存在?
过滤器里直接写属性即可:$.store.book[?(@.isbn)] 表示带 isbn 的书。若要拿所有深层同名字段,用递归下降 $..isbn。
「输出值」和「输出路径」有何区别?
输出值返回匹配到的 JSON 内容;输出路径返回如 $['store']['book'][0]['author'] 的定位串,便于对照文档里的位置或写断言说明。
字符串比较要注意什么?
过滤器里字符串请用双引号,如 @.name=="Ada"。数字直接写 @.score>=60。布尔用 true/false。语法因实现略有差异,以本页实时结果为准。
上文已说明该工具是本地处理还是会调用第三方接口,请按场景选用。
What it is for
JSONPath Online Evaluator runs expressions against a local JSON document—recursive descent, slices, filters, and value or path output. Payloads stay in your browser and are not uploaded.
How to use
- Paste or import JSON (or load the sample).
- Pick a preset or write a path such as $.store.book[*].author.
- Toggle value vs path output and inspect matches.
- Copy results into code, tests, or docs.
FAQ
Unlike regex?
JSONPath queries structured JSON; regex matches plain text. Prefer JSONPath for API field extraction.
Is JSON uploaded?
No. Parsing and evaluation stay on-device.
Which syntax?
Common JSONPath Plus features: $ , @ , .. , [*] , indexes, slices, and [?(…)] filters—similar to jsonpath.com.
How do I add filter “assertions”?
Use [?(…)] with @ for the current node. Examples: $.store.book[?(@.price < 10)]; $.store.book[?(@.category=="fiction")]; combine with && / || like [?(@.price<10 && @.isbn)].
How do I query or check a list?
[*] selects all elements; [0]/[-1] index; [:2]/[1:3] slice. To see if any item matches, filter and check a non-empty result, e.g. $.items[?(@.status=="ok")]. Field projection: $.items[*].id. Empty arrays usually yield no matches.
How do I test that a field exists?
Write the property in a filter: $.store.book[?(@.isbn)]. For deep same-named fields use $..isbn.
Values vs paths output?
Values return matched JSON; paths return locators like $['store']['book'][0]['author']—handy for locating nodes or documenting assertions.
String comparison tips?
Use double quotes in filters, e.g. @.name=="Ada". Numbers: @.score>=60. Booleans: true/false. Dialects vary slightly—trust this page’s live result.
Processing notes above describe whether work stays in your browser or calls third-party APIs.
404
工具不存在或链接有误。