JSON Diff

Structural diff of two JSON documents.

Open tool

Overview

JSON diff compares two JSON documents and reports the differences as a structural change list — added keys, removed keys, and changed values — with their JSON Pointer paths. It ignores whitespace and key ordering, which makes it far more reliable than a text diff for JSON.

It's the right tool when reviewing config changes, comparing API responses across deploys, or auditing whether two seemingly identical payloads actually differ. Developers, QA engineers, and SREs use a json compare tool to surface only meaningful changes without the noise of formatting.

How it works

Both documents are parsed into in-memory trees. The diff algorithm walks them in parallel: at each node it checks whether both sides are present, whether both are objects (recurse by key union), arrays (compared positionally by default, optionally by content), or scalars. Differences are emitted with RFC 6901 JSON Pointer paths so the output is portable to other tooling.

Key order is normalised before comparison, so {"a":1,"b":2} and {"b":2,"a":1} are reported as equal. Number comparison uses exact equality on the parsed numeric value, so 1 equals 1.0 but 0.1 + 0.2 does not equal 0.3 — JSON inherits floating-point imprecision.

Examples

Left:  {"name":"Alice","age":30,"tags":["admin","ops"]}
Right: {"name":"Alice","age":31,"tags":["admin","dev"]}

Diff:
~ /age      30 -> 31
~ /tags/1   "ops" -> "dev"
Left:  {"a":1,"b":2}
Right: {"a":1,"c":3}

Diff:
- /b   2
+ /c   3

FAQ

How are arrays compared?

Positionally by default: index 0 against index 0, index 1 against index 1. Toggle the "match by content" option to align elements by value first, which produces cleaner diffs when items have shifted positions.

Can I get the result as an RFC 6902 patch?

Yes — the structural diff maps directly to add/remove/replace patch operations. Switch the output mode to JSON Patch and you'll get a document ready to apply with the JSON Patch tool.

Does it ignore certain keys?

Optional ignore-list lets you specify paths (/metadata/timestamp, /etag) that are skipped during comparison. Useful when comparing API responses with rotating fields.

Try JSON Diff

An unhandled error has occurred. Reload ×