JSON diff viewer

View differences between two JSON documents side by side in your browser.

Inspect changed paths and the comparison tree without uploading data.

仅在浏览器内处理,不上传到服务器
数组感知模式可减少审查噪音
可导出 JSON Patch 与 JSON Merge Patch
所有内容都留在你的浏览器会话中,不会被上传。

Recommended workflow

  1. Clean or sort the JSON first with JSON Formatter or JSON Key Sorter when you want consistent input.
  2. Paste or upload the left and right JSON documents, then run Compare.
  3. Choose the array mode, match keys, tolerance, and path rules that fit the review.
  4. Review the summary, changed paths, tree, and exportable patch output.

Example

This example highlights changed values, reordered arrays, and added items in a clear side-by-side view.

之前

输入
{
  "orderId": "A-1001",
  "updatedAt": "2026-04-16T08:00:00Z",
  "customer": {
    "name": "Acme Corp",
    "tags": ["vip", "beta"]
  },
  "items": [
    {
      "sku": "A-1",
      "qty": 2,
      "price": 10
    },
    {
      "sku": "B-2",
      "qty": 1,
      "price": 4.5
    }
  ],
  "summary": {
    "currency": "USD",
    "total": 24.5
  }
}

之后

输入
{
  "orderId": "A-1001",
  "updatedAt": "2026-04-16T08:05:00Z",
  "customer": {
    "name": "Acme Corporation",
    "tags": ["beta", "vip"]
  },
  "items": [
    {
      "sku": "B-2",
      "qty": 1,
      "price": 4.5
    },
    {
      "sku": "A-1",
      "qty": 2,
      "price": 10.0001
    },
    {
      "sku": "C-3",
      "qty": 1,
      "price": 7
    }
  ],
  "summary": {
    "currency": "USD",
    "total": 24.5001
  }
}

What this example shows

This example highlights changed values, reordered arrays, and added items in a clear side-by-side view.

How to use

  1. Paste or upload the left and right JSON documents.
  2. Choose a comparison mode and review the paths that changed.
  3. Run Compare or Validate depending on your goal.
  4. Copy or download the result when you are done.

你可以做什么

  • 以语义方式比较 JSON,而不是逐行比较。
  • 可按 id、sku、code 等键去匹配数组项。
  • 可忽略路径、选择路径,或为不同路径应用不同的比较规则。
  • 使用数值容差,减轻细微浮点差异带来的噪音。
  • 导出 JSON Patch、JSON Merge Patch、变更路径,以及 Markdown 报告。
  • 折叠未变化的节点,并直接跳转到相关路径。

比较规则与输出

  • 处理完全在浏览器内完成,不会上传任何内容。
  • 支持严格、忽略顺序、多重集和按键匹配的数组模式。
  • 路径规则支持忽略、严格、忽略顺序、多重集、按键匹配和容差。
  • 数值容差仅应用于数字。
  • 需要时可以在解析前移除注释。
  • 大输入会使用先摘要后细节的渲染方式,并可禁用自动比较。

常见问题

我能按键比较对象数组吗?

可以。使用“按键匹配”,并列出如 id 或 sku 之类的键。也可以按路径单独覆盖规则。

如何忽略时间戳或请求 ID?

把它们加入“忽略路径”,或者在只希望某个子树适用时使用路径规则。

我能让某些部分保留数组顺序,而忽略其他部分吗?

可以。使用路径规则,在需要的地方设置忽略顺序、多重集,或仅按键匹配。

它支持带注释的 JSON 吗?

标准 JSON 不允许注释。只有在需要接受 JSONC 风格输入时,才启用“解析前移除注释”。

内容会上传到服务器吗?

不会。比较、规范化和导出都在你的浏览器本地完成。

我可以导出什么?

JSON Patch、JSON Merge Patch、变更路径,以及 Markdown 报告。