JSON 差异对比 — Uttir
Skip to main content

JSON 差异对比

语义化比较两个 JSON 值。忽略键顺序,高亮显示新增、删除和修改的路径,支持嵌套对象和数组。

JSON 差异对比 — A line-based diff treats JSON as text. It shows every line that changed, but it cannot tell you that a single key was renamed, that key order shifted, or that one array element was added.

Both JSON values are parsed and compared in your browser. Nothing is uploaded — the diff never leaves your device.

Was JSON 差异对比 useful?

JSON 差异对比是什么?

A line-based diff treats JSON as text. It shows every line that changed, but it cannot tell you that a single key was renamed, that key order shifted, or that one array element was added.

A semantic JSON diff compares the parsed structure. It walks both values, finds the added / removed / changed paths, and shows them in a table. Key order in objects is ignored by default (toggle off if order matters in your case).

使用方法

  1. Paste the two JSON values

    Drop the "before" JSON in the left panel, the "after" in the right. Both can be objects, arrays, or any JSON value — they do not have to be the same type.

  2. Read the table

    Each row is a path (e.g. users[3].email). Green rows are added, red rows removed, amber rows changed. Toggle "Show unchanged" to see what stayed the same.

  3. Copy the patch

    The "Copy patch" button puts a one-line-per-op summary in your clipboard — useful for sharing in chat or in a commit message.

示例

Detecting a renamed key indirectly

Two objects that differ in one nested value.

Before: {"user":{"name":"Ada","age":30}}
After:  {"user":{"name":"Ada","age":31}}

结果: 1 changed: user.age 30 → 31

Array element added

An element was added to the end of a tags array.

Before: ["eng","lead"]
After:  ["eng","lead","reviewer"]

结果: 1 added: [2] "reviewer"

常见问题

相关指南

相关工具

Last reviewed: 2026-11-21