JSON Diff
Last updated: 2 October 2026
Compare two JSON documents and see only what actually differs. Because the comparison is structural, reordering keys or reformatting changes nothing; the report lists each real change by its path, inside your browser.
What a structural diff sees
Both documents are parsed first, then walked together. Only differences in the data are reported: a key present on one side and not the other, a value that changed, or a value whose type changed — a number that became a string, an object that became an array. Whitespace and key order are not part of the comparison at all, because after parsing they no longer exist.
A type change is reported once, at the path where it happens, rather than being exploded into a removal and an addition for every leaf underneath. That keeps the report readable when a whole subtree changes shape.
Why this is not a line diff
A text diff — what git diff shows — compares lines. For JSON that is often misleading. Re-indenting a file, or having the same keys emitted in a different order, is normal when JSON is generated by different tools or versions of a library, and a line diff turns that into a wall of changes even though the data is identical.
The two documents below are the same document. A line diff reports four changed lines; this tool reports nothing:
{"a": 1, "b": 2}
{
"b": 2,
"a": 1
}
The reverse also holds, and it is the useful part: a single character changed inside a key name, or a number that moved from 3 to 4, shows up as exactly one change rather than being buried in reformatting noise.
Reading the path notation
Every change is reported at a path. $ is the document root; a dot walks into an object key, and a bracket indexes an array. So $.settings.indent is the indent key inside settings, $.features[2] is the third item of the features array, and $["weird key"] names a key that is not a simple identifier. The notation follows the same style as JSON Pointer, so a path in the report can be pasted into other JSON tooling.
What the diff cannot tell you
- Arrays are matched by position. Inserting an item at the front of a long array shifts every later element, so each is reported as changed even though the values only moved. That is a genuine limitation of any diff without a key to match on. If your items carry a stable
id, sort both sides by it first, or compare a version keyed by it. - It is not a patch. This reports differences; it does not emit a JSON Patch (RFC 6902) document and does not detect moved blocks. A value that moved appears as a removal at the old path and an addition at the new one.
- Values are compared exactly.
1and1.0are the same number to the parser, but1and"1"are different, and a missing key is different from a key explicitly set tonull.
Frequently Asked Questions
Does the order of keys matter?
No. Both documents are parsed before they are compared, and object keys are matched by name rather than by position. Reformatting a document or emitting its keys in a different order therefore produces an empty diff, exactly as it should, because the data is the same.
Why did inserting one array item show so many changes?
Arrays are matched by position, as in almost every structural diff. Inserting an item at the front of a long array shifts every later element one index, so each of them is reported as changed even though the values merely moved. Without a key to match on, nothing can know which items were inserted rather than altered. If your items carry a stable id, sort both sides by it before comparing.
What happens if one side is not valid JSON?
The comparison stops and the parser's own message is shown for whichever document failed, labelled left or right. Nothing is diffed, because two documents cannot be walked together until both parse.
Is my JSON uploaded anywhere?
No. Both documents are parsed with JSON.parse in your browser and compared in memory. No request carries them, and there is no account or server-side storage. You can load the page and then disconnect from the network — the diff still works.
Can it tell that a value was moved rather than changed?
No. This tool reports differences, it does not produce a patch. It does not emit a JSON Patch document and it does not detect values that moved from one place to another; a removal at the old path and an addition at the new one is what you will see.
Can I compare JSON that has comments or trailing commas?
No. The comparison uses the same strict parser as the rest of the site, so JSON5, comments and trailing commas are rejected. If a document fails to parse, run it through the formatter or the validator first to see where.
Need to turn JSON into a table? JSON to CSV does that. Spotted a bug? Get in touch.