What this tool does
It normalises both sides — two-space indentation, keys sorted — then compares them line by line and shows the result as a unified diff:
@@ -2,4 +2,4 @@
"host": "localhost",
- "port": 8080,
+ "port": 3000,
"tls": true
- is the original, + is the modified, and the @@ line gives the region. It is the format git diff and patch speak.
What counts as a difference
| difference? | |
|---|---|
| Indentation, line breaks | no |
| Key order in an object | no, by default |
| Element order in an array | yes |
| A value that changed | yes |
Objects and arrays are treated differently because JSON treats them differently: an object is an unordered set of pairs, an array is a sequence. Reordering the keys of an object gives the same value; reordering the elements of an array gives another one.
Down to the last digit
{ "id": 12345678901234567890 }
{ "id": 12345678901234567891 }
These two documents differ, and this tool says so.
That is worth stating because it did not use to. Normalising both sides through a plain JSON parse sent every number through a double-precision float, and the two identifiers — twenty digits, differing only in the last — collapsed into the same value. The diff came back empty, which reads as no differences.
An empty diff is an assertion, not a shrug. A comparison tool is precisely the one you ask to see what your eyes cannot, so both sides are now read without loss and compared as written.
Duplicate keys are reported
If one of the two documents repeats a key, the comparison stops and says so, exactly as the JSON formatter does. Keeping only the last of each — what most parsers do quietly — would let a genuine difference between the two files vanish before the comparison even starts.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.