Skip to the tool

JSON diff

MDV Tools

Two documents in, and what actually changed out — by path, not by line.

Runs on this device Works offline
paste json on both sides
How this works

Both sides are parsed and then walked together, so the comparison is of structure and not of text: the order of keys in an object never matters, whitespace and indentation never matter, and 1, 1.0 and 1e0 are the same number. Each difference is reported at its path — parts[2], machine.name — with + for something only in After, - for something only in Before, and ~ for a value that changed. A change of type is reported as a change, with both types named, because "1" becoming 1 is the bug behind a great many afternoons.

Arrays are the part where a diff has to make a choice, so the choice is yours. By position compares index against index, which is right for a fixed tuple and noisy for a list where one item was inserted at the front. In any order treats each array as a bag of values: it reports what was added and removed regardless of where, and says nothing about a reordering, which is right for a set of tags and wrong for a sequence of steps. Neither tries to guess which item "is" which by an id field; that guess is what makes other diff tools confusing.

Duplicate keys in an object are resolved by the parser before this page sees them — the last one wins, silently, as it does everywhere in JavaScript — and integers beyond about 9 quadrillion lose precision on the way in, so two documents that differ only past that point can read as identical. Both are noted when they can be detected. Each side is capped at 2 MB.

Everything is compared in this tab: no upload, no server, nothing stored. The Dark button keeps its own setting in this browser's local storage.