Deep-compare two JSON documents and list added, removed, and changed keys with their paths
Paste the JSON documents you want to compare into the left (A) and right (B) inputs, and the differences are shown automatically. It is useful for comparing old and new API responses, checking configuration file changes, or matching expected and actual values in tests. "Format both" aligns the indentation, and "Swap A and B" reverses the direction of the comparison.
The leading symbol of each line shows the kind of difference. "+" is a key that exists only in B (added), "-" is a key that exists only in A (removed), and "~" is a key that exists in both but with different values (changed). The location is shown as a path such as a.b[2], where dots are object keys and square brackets are array indexes.
Arrays are compared at the same index. Inserting or reordering elements is detected as changes from that position onward. When the types differ (for example the string "1" versus the number 1, or an object versus an array), that location is treated as a changed value without descending further.
It lists added keys, removed keys, and changed values, each with a path such as a.b[2]. Objects are compared key by key and arrays are compared at the same position (index), recursively. When the types differ, the difference is treated as a changed value.
No. The order of object keys does not affect the comparison. Only the set of keys and their values are compared, so if the contents are the same the result is "no differences" even when the keys are reordered. Arrays are compared position by position because order is meaningful there.
No. The comparison and formatting run entirely in JavaScript within your browser. The JSON you enter is never sent to or stored on any server.