We use cookies to understand how DevToolsHub is used and to improve your experience. You can choose which types of cookies to allow.
Compare two JSON objects and highlight the differences.
Loading...
Loading...
JSON Diff is the process of comparing two JSON objects to identify exactly what changed between them. Unlike a simple text comparison that treats each line as a unit, a JSON diff checker understands the structure of JSON data. It parses both inputs into their underlying object representations and then performs a deep comparison— recursively traversing every key, value, nested object, and array element to find additions, removals, and modifications. This means that two JSON strings with different formatting, different whitespace, or different key orders but identical data will be correctly identified as having no differences.
JSON (JavaScript Object Notation) has become the dominant format for data exchange on the web. APIs return JSON, configuration files use JSON, databases store JSON documents, and application state is often serialized as JSON. When you have two versions of a JSON document — perhaps an old API response and a new one, or a staging config and a production config — you need to know exactly what changed. Manually scanning through hundreds of lines of JSON is error-prone and time-consuming. A JSON diff checker automates this, highlighting every difference with its full path so you can quickly understand what was added, removed, or modified.
DevToolsHub’s JSON Diff Checker runs entirely in your browser. It parses both JSON inputs, performs a recursive deep comparison, and presents the results in a clear, color-coded tree view. Each difference is shown with its full path (e.g., config.server.port or items[2].name), the old value, and the new value. A summary panel shows the count of additions, deletions, and changes at a glance.
There are two approaches to comparing objects: shallow comparison and deep comparison. Shallow comparison only looks at the top level of an object — it checks whether the same keys exist and whether their immediate values are equal. If a key’s value is a nested object, shallow comparison compares by reference, not by content. This means that two different objects with identical contents would be reported as different, because they are different references in memory.
Deep comparison, on the other hand, recursively traverses the entire object tree. When it encounters a nested object or array, it doesn’t stop at the reference — it goes inside and compares every key and value within that nested structure. This ensures that changes deep within a JSON document are always detected, regardless of how many levels of nesting they are buried under. For example, if you have a configuration object like { server: { port: 3000 } } and the port changes to 8080, deep comparison will find it at the path server.port.
DevToolsHub’s JSON Diff Checker uses deep comparison exclusively. Every difference, no matter how deeply nested, is reported with its full path from the root of the JSON object. This makes it easy to locate exactly where changes occurred, even in large, complex JSON structures with many levels of nesting. Arrays are compared element by element using indices, so changes to individual array elements (and elements of arrays within arrays) are always detected.
Loading...