DataHub Tools JSON Diff Compare

JSON Diff and Compare Tool

Local-first

Compare two JSON objects and list added, removed, and changed paths locally.

How this tool actually works

The tool splits two JSON documents at a standalone --- or === line, parses both values, and recursively reports added, removed, and changed paths. Arrays are compared by index; the report is descriptive text, not an applicable JSON Patch.

  • Compare objects recursively
  • Report added, removed, and changed paths
  • Compare array values by index

How to use it

  1. Paste the first JSON value, a separator line, then the second value.
  2. Run the comparison and inspect each reported path.
  3. Review array insertions separately because index shifts can create many changes.
  4. Do not treat the report as a patch that can be applied automatically.

Quick example

Example input

{"roles":["admin","editor"]}
---
{"roles":["viewer","admin","editor"]}

Expected result

Index-based changes are reported for roles[0], roles[1], and roles[2].

A value inserted at the start of an array shifts every later index. Keys containing dots or brackets can make report paths ambiguous.

Best use cases

  • Review small configuration changes.
  • Compare API response shapes.
  • Inspect ordinary JSON objects with stable array ordering.

References and scope

RFC 6902 defines an applicable JSON Patch format. This tool emits a human-readable recursive comparison and does not implement that format.

Sources checked July 24, 2026. Specifications and platform behavior can change; verify the sources before formal use.

Known limitations

  • Duplicate object keys are overwritten during JSON parsing.
  • Large integers can lose precision before comparison.
  • Use JSON Patch or a semantic diff algorithm when changes must be applied or arrays matched by identity.

FAQ

How do I separate the two inputs?

Place --- or === on its own line between the two strict JSON values.

How are arrays compared?

By numeric index, not by object identity or longest common subsequence.

Does it generate JSON Patch?

No. The output is a text report and cannot be applied as RFC 6902 operations.

Can large integers compare incorrectly?

Yes. Values outside JavaScript's safe integer range may be rounded before comparison.