为什么用这个工具
03JSON 差异在浏览器本地运行,适合快速处理与复制结果。
JSON 差异适用于日常高频小任务,打开即用。
默认本地处理,便于快速检查与复制结果。
如何使用
02复制前快速检查
03先确认输入格式符合你的预期。
在把结果用于文档、链接、配置或消息前快速扫一眼。
只复制你真正需要的输出。
使用场景
Capture a sample response before and after a backend change. Drop both in and immediately see which fields were added, removed, or changed — far faster than scanning two pretty-printed payloads side by side.
Paste prod's feature-flag JSON on one side and staging's on the other. The structural diff surfaces every divergence without false positives from key-order or formatting differences.
When debugging a state-management bug, capture the state object before and after the suspect action. The diff shows exactly which fields changed — useful for finding unexpected side effects.
Compare the original document against the post-patch result to confirm the patch did what you intended. Especially useful when the patch has many operations.
When migrating between schema versions, run the migration on a sample document and diff against expected output. Faster than writing assertion-by-assertion tests for ad-hoc changes.
使用技巧
- 01Object diff is order-insensitive; array diff is positional
JSON objects are unordered by spec, so <code>{a:1,b:2}</code> equals <code>{b:2,a:1}</code> — no diff. JSON arrays are ordered, so <code>[1,2]</code> ≠ <code>[2,1]</code> — diff. For order-insensitive array comparison (set semantics), this tool isn't the right fit — sort both arrays first and re-diff.
- 02Type changes count as 'changed'
If a value's type changes (e.g., <code>"42"</code> string to <code>42</code> number), it counts as one changed value. The diff line shows both the old and new representations so the type shift is visible.
- 03Counts represent leaf-level changes
Added / removed / changed counts measure primitive (leaf) operations, not whole-subtree changes. If you delete a nested object with 5 keys, you get 5 'removed' counts, not 1. This is the granularity most useful for understanding how impactful the diff is.
- 04Use the JSON Formatter first if inputs look unstructured
If your two inputs are minified or contain extraneous whitespace, paste through the JSON Formatter first. The diff itself ignores formatting, but pretty-printing first makes the diff output easier to read.
常见问题
01
这个工具会上传数据吗?
默认在浏览器本地处理。
相关工具
03JSON 格式化→
格式化、压缩并校验 JSON。
JSON 到 typescript→
JSON 到 typescript,在浏览器中快速完成单项任务。
文本差异检查→
文本差异检查,在浏览器中快速完成单项任务。