JSON Diff — Structural Comparison Tool
Compare two JSON documents and see exactly which keys were added, removed, or changed by path — not a noisy line-by-line text diff.
Interactive Client Prototype Sandbox
Disclaimer: This free tool is provided “as is,” without warranties of any kind, and is for general informational purposes only — not professional, legal, financial, medical, tax, or engineering advice. Results may contain errors; verify anything important independently and use at your own risk. We accept no liability for any loss or damage arising from its use. See our Terms of Use for details.
Step-by-Step Guide
Paste the original JSON on the left and the modified version on the right. The tool parses both and recursively compares them: for objects, every key present in only one side is reported as added or removed; for keys present in both, if the values differ the tool recurses into them (for nested objects and arrays) or reports a direct 'changed' entry once it reaches a primitive value (string, number, boolean, or null).
Arrays are compared by index — if you rearrange the order of items in an array without changing their content, this will show as a change at each shifted index, since array order is semantically meaningful in JSON (unlike object key order, which this tool correctly ignores).
Each result line shows the exact path (e.g. `settings.beta` or `tags[2]`) so you can go straight to the relevant part of the source document.
Comparing {"version": 1, "tags": ["free"]} to {"version": 2, "tags": ["free", "offline"]} reports: `version` changed from 1 to 2, and `tags[1]` added with value "offline".
Who it's for
Backend developers, API integrators, and QA engineers comparing API responses, config files, or database exports.
Core Features
- Walks both JSON documents recursively and reports added, removed, and changed values by exact key path.
- Correctly compares arrays by index and objects by key, regardless of key order in the source.
- Color-coded results: green for additions, red for removals, amber for changed values (old → new).
- Live summary counts of added / removed / changed entries.
- Runs entirely in your browser — nothing is uploaded, which matters when comparing production payloads.
🛡️ No tracking — your inputs, keys, and details never leave this client sandbox.
Related tools
How is this different from a normal text diff?
A text diff compares JSON as lines of characters, so reformatting, reindenting, or reordering keys produces noisy changes even when the data is identical. This tool parses both documents into real JSON values first and compares the resulting structures, so key order never matters and only actual data differences are reported.
Does key order matter in the comparison?
No, for objects. {"a":1,"b":2} and {"b":2,"a":1} are treated as identical, matching how JSON itself defines object equality — key order is not semantically meaningful in a JSON object. Array order does matter, since arrays are ordered sequences by definition.
How are changed array items reported?
Arrays are compared position by position. If an item is added or removed from the middle of an array, every item after that position will show as 'changed' at its index, because index-based comparison has no way to know an item shifted rather than changed — this mirrors how most structural diff tools handle arrays without a dedicated list-alignment algorithm.
What counts as a 'changed' value versus 'added'/'removed'?
A key or index present in both documents but holding a different value is 'changed'. A key or array index present only in the original is 'removed'; present only in the modified version is 'added'. Nested objects and arrays are recursed into rather than reported as one large changed blob, so you see the specific field that actually differs.
Is either document sent anywhere?
No. Both JSON documents are parsed and compared entirely in your browser using JavaScript's built-in JSON.parse — useful when comparing production API responses, customer records, or internal config that shouldn't be pasted into a third-party server.
Why a text diff misleads on JSON
JSON is a serialization format, not a canonical one — the same data can be written with 2-space or 4-space indentation, on one line or many, with keys in any order, and all of it parses to the identical value. A line-based text diff tool has no awareness of this: it compares characters and whitespace, so a config file that was simply re-serialized by a different tool or with keys in a different order can produce a diff that flags nearly every line as changed, burying the one field that actually matters. This is the core reason structural diffing exists as a distinct category of tool from general-purpose text diffing.
Walking the tree instead of the text
A structural JSON diff parses both inputs into in-memory values first, discarding formatting entirely, and then walks the two trees together. At each object, it compares the key sets directly (a key present only on one side is an addition or removal); at each array, it compares by position; and at each primitive value, it does a direct equality check. The result is a list of concrete differences addressed by path — `user.address.city` changed, `permissions[3]` added — which maps directly onto how a developer would describe the change in a sentence, unlike a wall of `+`/`-` lines from a text diff.
Where this matters most
Structural JSON diffing earns its keep in a few recurring situations: verifying that an API response matches an expected shape after a backend change, spotting configuration drift between a staging and production environment file, reviewing what a database migration script actually changed in an exported record, and debugging why two payloads that 'look the same' at a glance are failing an equality check somewhere downstream. In every case, the value comes from suppressing formatting noise so the few fields that truly changed are immediately visible.