JSON Diff: compare two JSON documents

Paste two versions. See exactly which values were added, removed or changed — by path, not by line.

runs in your browserno uploadno sign-up

Paste JSON or load the sample to start.
Paste JSON or load the sample to start.

Differences

Paste valid JSON on both sides to compare.

Why a structural diff

A normal text diff compares lines, so re-indenting a file or reordering keys makes everything look different. This tool parses both sides and compares the data: object keys are matched by name regardless of order, arrays are compared index by index, and each difference is reported with its path, such as $.user.roles[1].

Four kinds of difference are shown: added (only in B), removed (only in A), changed (same type, different value), and type change (for example 42 became "42" — a common source of bugs between services).

Frequently asked questions

Does key order matter in the comparison?

No. JSON objects are unordered, so {"a":1,"b":2} and {"b":2,"a":1} are reported as identical.

How are arrays compared?

Position by position. If an item is inserted at the start of an array, every following index shows as changed. Sort arrays of records by a stable key first if order is not meaningful in your data.

Is 1 the same as 1.0?

Yes. Both parse to the same number, so they are equal. "1" (a string) and 1 (a number) are reported as a type change.

Are my files uploaded?

No. Both documents are parsed and compared in your browser.