JSON 对比
对比两个 JSON 文档的结构差异
左侧(原文)
右侧(修改后)
See exactly what changed between two JSON payloads
Eyeballing a diff between two long JSON files is painful and error-prone. A structural compare ignores key order, normalizes whitespace, and shows you only what actually changed — added keys, removed keys, value differences — with the full path to each change so you can act on it instead of hunting for it.
Use the comparer when you need to
Diff two API responses
Confirm whether a backend change altered the response shape or values between deploys, environments, or versions.
Spot regressions in fixtures or snapshots
Find the field that drifted in a test fixture or snapshot file without manually re-reading the whole document.
Compare model outputs across runs
Diff structured AI responses to see which fields are stable and which fluctuate between prompts or model versions.
How to compare JSON quickly
- 1
Paste the first JSON document on the left and the second on the right.
- 2
Click Compare to see additions, removals, and value differences with full paths.
- 3
Copy or share the diff to discuss the change with a teammate.
Keep going
Validate against an expected shape
Move from ad-hoc diffs to enforcing a schema when the contract really matters.
Validate model output
Combine diff and schema checks for AI-generated JSON to catch shape and value drift in one place.
Format both inputs first
Beautify both payloads before diffing for the cleanest reading experience.
Compare non-JSON text
Use line-based diff for logs, configs, and plain text where structure isn't JSON.
Common compare workflows
Paste prod and staging payloads side-by-side to find the exact field that drifted.
Confirm the new endpoint returns the same structure and values as the legacy one before flipping clients.
Compare structured output from two model versions on the same prompt to verify downstream code still works.
相关工具
常见问题
左侧粘贴第一个 JSON,右侧粘贴第二个 JSON,然后点击 Compare。工具会做结构化 diff,并用完整路径标出新增、删除和变更的值。
不会。它做的是语义对比(semantic comparison),只比较实际数据,不受 key 顺序影响。{"a":1,"b":2} 和 {"b":2,"a":1} 会被认为相同。
可以,这也是最常见的用途之一。把期望的 API response 放一边,实际返回放另一边,diff 会立刻显示结构或数值上的差异。
带 + 的绿色行表示只在第二份 JSON 中存在;带 - 的红色行表示只在第一份 JSON 中存在;黄色/橙色表示两边都有但值不同。