JSON Diff Tool
Compare two JSON documents and instantly see what changed. Semantic comparison ignores key order — only real differences are reported. Color-coded results show added, removed, and modified fields.
Paste two JSON documents above and click Compare
Why semantic JSON diff matters
Regular text-based diff tools (like the diff command, or git's default diff) compare files line by line. For JSON, that's often wrong. Two JSON documents can be byte-different but logically identical — different key order, different whitespace, different number formatting — and a text diff will mark every line as changed.
A semantic JSON diff understands the underlying data model. It parses both documents, then compares the resulting structures recursively. Key order doesn't matter because JSON objects are unordered. Whitespace doesn't matter because it's not part of the data. Only real differences — actual changes to keys or values — are reported.
This matters in real workflows: comparing API responses across versions, reviewing config changes, validating that a transformation preserved data correctly, or auditing what changed between deployments.
How the diff works
Our diff algorithm walks both JSON trees in parallel, classifying each difference:
+ Added
Keys or array items present in the right document but not the left. Shown in green with their values.
− Removed
Keys or array items present in the left document but not the right. Shown in red.
≠ Changed
Same key in both, different values. Both old and new values are displayed so you can see what changed.
= Unchanged
Identical values are omitted from output by default — keeps the diff scannable for big documents.
Each difference is labeled with a JSONPath-style location like $.users[2].email, making it easy to see exactly where in the structure the change occurred. Even for deeply nested data, you can navigate directly to the changed field.
When you need a JSON diff
- API version comparison. Compare a v1 and v2 response from the same endpoint to understand what changed between versions.
- Regression testing. When you change code that produces JSON, diff the new output against a known-good baseline to catch unintended changes.
- Config review. Before deploying a config change, diff against the current production config to verify exactly what's changing.
- Data migration validation. After migrating data between systems, diff a sample record from source and destination to confirm the transformation preserved everything.
- Audit trails. Compare two snapshots of the same record at different times to see what changed.
- Bug investigation. Reduce a working request and a broken request to find the field whose value triggered the bug.
FAQ — Json Diff
{"a":1,"b":2} and {"b":2,"a":1} are reported as identical. This is what makes the comparison semantic rather than textual.{"id":"42"} is different from {"id":42}; (2) one has a trailing whitespace character or BOM that's not visible but affects parsing. Try formatting both with the JSON Formatter first to normalize.$.users[2].address.city. This makes it easy to find the change in a large document and to communicate the change to others.json-diff.diff command)?Need the difference as something a machine can apply? The JSON Patch generator emits an RFC 6902 patch from the same two documents.
If the two sides differ only in key order or whitespace, compare their canonical forms instead — and format both first if either is minified. The glossary explains structural diffing.