What is JSON Diff?
The JSON Diff tool compares two JSON documents structurally and reports what changed by path — additions, removals, and value changes. Unlike a text diff, it parses both sides into their JSON data model (per RFC 8259) and walks the trees, so reordered whitespace and formatting do not create false differences.
Paste a left and a right document; the tool lists each differing location using a path like user.roles[2] or address.zip, along with the old and new values.
Both documents are parsed and compared in your browser.
Why Use This Tool?
When an API response or config changes, you need to know which fields actually moved, not which lines reflowed. A structural diff pinpoints the exact paths that were added, removed, or changed, which a line-based diff cannot do reliably for JSON.
- See semantic changes by JSON path.
- Ignore formatting and whitespace noise.
- Track drift between API versions or config snapshots.
- Locate exactly which field changed and to what.
How Does This Tool Work?
The tool parses both inputs with JSON.parse and recursively compares them. At each node it checks equality; when values differ it records the path and classifies the change. Objects are compared by key: a key only on the right is added, a key only on the left is removed, and a shared key with different values is changed. Arrays are compared index by index.
Primitive equality uses strict identity (Object.is), so 1 and "1" differ, and structural type mismatches (object vs array) are reported as changes.
Understanding Your Results
Each result shows a path, a change type (added, removed, or changed), and the relevant left and/or right value. The root is shown as $ when the top-level values themselves differ in type or primitive value.
Because arrays are compared by index, inserting an item near the front shifts every following index and can report many changes even if the items merely moved. Treat arrays as positional data when reading the diff.
Why Tracking This Matters
Config and contract drift causes real outages. A precise, path-level diff makes it easy to review exactly what changed between two payloads or environments, catching an unintended field change before it ships.
Benefits of Using JSON Diff
- Structural, path-based comparison
- Ignores formatting differences
- Classifies added, removed, and changed
- Shows old and new values
- Handles nested objects and arrays
- Runs entirely in your browser
How Is the Result Calculated?
The tool recursively walks both trees. Two nodes that are Object.is-equal are skipped. If either side is not an object, or the two sides disagree on object-vs-array, the node is a change. Objects diff over the union of their keys; arrays diff over indices from 0 to the longer length, reporting overflow indices as added or removed.
Tips for Better Results
- Remember arrays compare by index — moved items show as changes.
- Note that 1 and "1" are different because comparison is type-strict.
- Format both sides first if you want to eyeball them alongside the diff.
- Use path output to jump straight to the changed field in your source.
- For line-oriented text, use the Diff Checker instead.
Standards and References
Conclusion
JSON Diff compares two documents by structure and reports precise, path-level additions, removals, and changes, free of formatting noise.
It is the right tool for tracking API and config drift; for line-based text, reach for the Diff Checker instead.