A JSON diff compares two parsed JSON values and lists structural differences. It does not compare pretty-printed text as a string. After JSON.parse on both boxes, object keys are treated as maps and array items are compared by index. This JSON Diff runs in the browser. Nothing is uploaded.
That is a different job from a formatter or a sorter. Format changes whitespace. Sort changes key order for humans and git. Diff answers whether two values differ and where. Key order in objects is not treated as a difference, because JSON object member order is not semantically significant. Array order is significant: ["a","b"] is not the same as ["b","a"].
Use this when two API responses should match, when a fixture drifted, or after you sorted one side and still need to see value changes. If a box might be illegal JSON, validate it first.
Invalid JSON is not compared. The status names which box failed. If either document is larger than the traversal limit, the output is cleared. There is no half-diff.
JSON A has age 30 and tags a, b. JSON B has age 31, tags a, c, and an added email. Compare should report a changed age, a changed tags[1], and an added email. name and meta.ok stay equal and are omitted from the list.
changed age
- 30
+ 31
added email
changed tags[1]
- "b"
+ "c"
Arrays are compared by index, not by longest common subsequence. The tool does not decide that an item “moved.” If you insert at index 0, later indexes look changed. That is honest and deterministic. It is not a git line diff and it is not JSONPath.
If you need to inspect one payload instead of comparing two, use the JSON Viewer. If key order is the only noise, sort both sides with the JSON Sorter, then compare values. Pretty-print either side on the JSON Formatter if you want to read it; formatting does not change the diff.
Equal values produce the line No differences. Two primitives are compared directly: true versus false is a root change. An object versus an array is a type change at that path, and the output shows both JSON values. Nested objects reuse the same rules: a missing child key is removed, a new child key is added, a different child value is changed with minus and plus lines.
Whitespace, comments, and trailing commas never reach the comparison. They fail parse on the box that contains them. Duplicate keys in the source text are already gone after parse, so the diff cannot show “both” properties.
1 is not the string "1".The full procedure is how to compare two JSON documents.
Parse and compare run in this browser. The payloads are not sent to YallaSolve for this tool.
Structural comparison of two parsed JSON values. Object keys are compared as maps. Array items are compared by index, not moved with a text diff. This is not a merge tool.
No. Both sides are parsed with JSON.parse. The list is a structural comparison, not a line-by-line pretty-print diff.
JSON object member order is not semantically significant. Only missing keys, extra keys, and value changes are listed.
No. Array items are compared by index. An insert at the start makes later indexes look changed. There is no move detection.
No. This page only lists differences. It does not produce a merged JSON value or a JSON patch.