JSON Diff Online
Compare JSON or YAML side by side and focus on real value changes instead of formatting or object key order.
How JSON Diff works
Paste the before and after document, select JSON or YAML and click Compare. The tool parses both sides into data values and calculates changes. The object keys are sorted for display and the normalized documents are compared line by line.
This removes a common source of noise. If one API response writes id before name and another writes name before id, the objects still contain the same members. Reformatting or changing indentation also does not count as a data change.
The result includes:
- a side-by-side view of removed, added, and unchanged lines;
- counts for added, removed, changed, and unchanged values;
- semantic comparison for objects, arrays, and primitive values;
- the same workflow for JSON and YAML documents.
Object order is ignored; array order is not
JSON object members are addressed by key, so {"a":1,"b":2} and {"b":2,"a":1} compare as equal. Arrays are ordered sequences. Changing ["admin", "editor"] to ["editor", "admin"] is therefore a real change even if your application later treats those values as a set.
It’s an important distinction when analyzing responses from APIs. Presentation noise is a re-ordered object; a re-ordered queue, priority list or series may behave differently.
Use the summary as a map, not a verdict
The diff reports structural changes, but it does not know your schema or business rules. A new optional field may be harmless, while changing "userId": "007" to "userId": 7 may be breaking even though it looks small. It also cannot tell whether a timestamp, URL, permission, or monetary value is semantically correct.
For regression work, use the diff to locate changes and then evaluate them against the API contract or expected fixture. Both inputs must parse in the selected format; repair malformed JSON with JSON Fix before comparing it.
FAQ
Why are sorted and unsorted versions reported as identical?
Object keys are normalized before line display, and compared by name. Key order and indentation does not affect data value.
Does the tool ignore array order?
No. Array positions are significant, so moving, inserting, or removing an item appears as a change.
Is this a JSON Schema compatibility check?
No. It compares two parsed values. If you need to verify that the newer document is still compatible with a formal interface, use a schema validator or contract test.