ITEngineeringTools

JSON Structural Diff

Compare JSON by structure and locate added, removed and changed values by JSON Pointer.

Input

Result

How it works

Objects are compared by key and arrays by index. JSON Pointer escapes slashes and tildes in keys. Duplicate member names and numeric values that cannot round-trip at supported precision are rejected before comparison.

Formula

Recursively compare the union of keys and use ordered indices for arrays.

Practical examples

Changed API status

Left JSON: {"status":"old"}
Right JSON: {"status":"new"}

Changed /status

Object key reordering

Left JSON: {"a":1,"b":2}
Right JSON: {"b":2,"a":1}

Differences: 0

Added array member

Left JSON: [1,2]
Right JSON: [1,2,3]

Added /2

Technical references