JSON DIFF

JSON 对比,按路径找出差异。

比较两份 JSON,按路径查看新增、删除、变更与移动;对象数组可智能按稳定 ID 对齐,也可改为按下标比较。全程本地处理,不上传数据。

文件仅在本机读取,不会上传。

怎么用?

粘贴或从本地导入两份 JSON 后点击「对比」。智能模式会匹配稳定 ID 并标出移动;切换为按下标比较可保留数组位置语义。路径可复制,长值可展开。

常见问题

它安全吗?数据会上传吗?

全程在浏览器本地运行,不会上传你的任何数据。

支持哪些设备?

只要是现代浏览器(手机 / 平板 / 电脑)均可使用,无需安装。

示例与注意事项Example & notes

一个例子A worked example

排查接口改版:左侧导入或粘贴旧 JSON,右侧放新版本;对象数组可按唯一 id 自动匹配,按路径查看新增、删除、变更与移动,点路径复制,还能展开完整值并下载报告。Check an API revision: load or paste the old JSON on the left and the new version on the right. Object arrays can match by a unique id; inspect additions, removals, changes and moves by path, expand full values, and download a report.

注意事项Things to watch

相关问答More Q&A

两个 JSON 怎么对比才准?How do I get an accurate JSON diff?

两边都只放纯 JSON(不要外层包裹对象名),确认缩进与键名完全一致;如果一个是接口返回、一个是配置文件,先把结构对齐再比,否则差异会被结构性错位淹没。Put plain JSON on both sides (no wrapper object), make sure indentation and key names match, and align the structure first when one side is an API response and the other a config file — otherwise structural mismatches drown out the real changes.

智能模式如何对齐数组?How does smart mode align arrays?

对象数组先尝试使用两侧共有且唯一的 id/key 等标量字段;没有可用稳定字段时,会匹配完全相同的元素,再按位置比较未匹配片段。重复键或同时大幅改动会降低匹配确定性;需要严格位置语义时请选择「按下标比较」。Object arrays first try a shared, unique scalar id/key. Without one, identical items are aligned before unmatched sections are compared positionally. Duplicate keys or many simultaneous edits make matching less certain; choose index mode when positions must be compared strictly.

JSON 文件会上传吗?报告能直接分享吗?Are JSON files uploaded, and are reports safe to share?

不会上传,比较和本地文件读取都在浏览器中进行。复制或下载的报告包含差异路径和值;对外分享前应先检查并移除令牌、个人信息等敏感内容。No. Comparison and local-file reading happen in your browser. Copied or downloaded reports include difference paths and values; remove tokens, personal data and other sensitive content before sharing.

深入阅读

觉得好用?Found it useful?