JSON Diff
Compare two JSON documents key by key and value by value. The result is a diff listing every path that was added, removed or changed, with the value from each side. Everything runs locally.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
How the diff is built
The editor holds document A and the Second JSON box holds document B; both must parse as strict JSON. The tool walks the two trees together and prints one line per difference with a path starting at $ that uses dotted keys and bracketed indexes: a minus line for a value only in A, a plus line for one only in B, and both when a scalar changed.
When to reach for it
Compare a saved config against what a service returned, check whether an API response changed after a deploy, or confirm two environments are in sync. The path on each line points straight at where the documents diverge, which beats eyeballing two long files side by side.
Array comparison modes
By default arrays compare index by index, so one insertion near the front makes every later element look changed. With Ignore array order on they are treated as multisets: elements present in both sides in equal counts are skipped wherever they sit, and leftovers are reported under a wildcard path such as tags[*].
Caveats and privacy
A changed scalar prints as both a minus and a plus line for the same path and counts once as changed, while a key on only one side prints one line and counts as added or removed. An empty first input yields no output, and a blank second box is treated as an empty object. Both documents are parsed in the page, so nothing is sent anywhere.
Questions
What do the +/- lines mean?
A line starting with - is the value only in A (removed); a line starting with + is the value only in B (added). A changed value shows both a - and a + line for the same path.
How does "ignore array order" work?
Arrays are compared as multisets: an element present in both sides in equal counts is treated as unchanged regardless of position. Otherwise arrays are compared index by index.
Why does a changed value print as two lines?
The output lists leaves: a scalar that differs appears once as removed from A and once as added to B on the same path, and the stats count it once as changed. A key that exists on only one side prints a single line and counts as added or removed instead.
Related tools
See categoryJSON Formatter & Validator
Pretty-print, minify, recursively sort keys or validate JSON, with line/column errors.
JSON to YAML
Convert JSON to YAML on your device, with a 2- or 4-space indent.
Query String <-> JSON
Parse a URL query string into JSON, or build a query string from a JSON object. Local only.
NDJSON <-> JSON Array
Convert newline-delimited JSON to a JSON array and back, one compact value per line.