JSON Diff

Paste two JSON objects and compare them instantly. Added, removed, and changed keys are highlighted side by side.

JSON A (original)
Waiting for input…
JSON B (modified)
Waiting for input…
Diff Result
Added Removed Changed Unchanged
Paste JSON into both panels and click Compare

What is a JSON diff tool?

A JSON diff tool compares two JSON objects and highlights the differences between them — showing which keys were added, which were removed, and which values changed. Unlike a plain text diff which compares raw characters line by line, a semantic JSON diff understands the structure of the data and operates at the level of keys and values, making the output much easier to interpret.

This tool works entirely in your browser. Paste your two JSON objects into the left and right panels, click Compare, and see a colour-coded diff instantly. Nothing is sent to any server.

When do you need to compare JSON?

  • API versioning — when updating an API, diff the old response schema against the new one to document breaking changes for consumers.
  • Configuration drift — compare a production config file against the expected config to find keys that were added, removed, or changed without documentation.
  • Feature flags and settings — diff two environments (staging vs production) to find settings that differ and may explain different behaviour.
  • Database record auditing — compare a JSON record before and after an update to see exactly which fields changed and what the old and new values were.
  • Test fixture maintenance — when a test fixture JSON file changes, diff the before and after to verify only the intended fields changed.
  • Contract testing — compare a mock API response against the real API response to confirm the mock is still accurate.

How to read the diff output

The diff uses a colour-coded tree view:

  • Green (+) — a key or value was added in JSON B that was not present in JSON A.
  • Red (–) — a key or value was present in JSON A but is absent in JSON B.
  • Yellow (~) — a key exists in both but the value changed. The old value is shown with strikethrough, the new value follows an arrow.
  • Grey — the key and value are identical in both JSON objects.

The stats bar at the bottom summarises the total number of additions, removals, and changes.

JSON diff vs text diff

A text diff tool (like git diff) compares files character by character and line by line. It can be confused by key ordering — if you sort the keys in one JSON object but not the other, a text diff shows many "changes" even though the data is semantically identical. This tool normalises the structure before diffing, so key order does not affect the result. Two JSON objects with the same keys and values in different orders are shown as identical.

Frequently asked questions

No. This tool performs a semantic diff, not a text diff. {"a":1,"b":2} and {"b":2,"a":1} are considered identical because JSON objects are unordered by specification. Only when the values differ will a change be reported.

Yes. Arrays are compared index by index — index 0 in JSON A is compared against index 0 in JSON B, and so on. If one array is longer, the extra items are shown as additions or removals. For arrays of objects, each object at the same index is diffed recursively.

The Compare button validates both inputs before diffing. If either panel contains invalid JSON, you will see an error message identifying which panel has the problem and what the error is. Fix the syntax error first, then compare.

Yes. The diff engine recurses into nested objects and arrays at any depth. The indentation in the output reflects the nesting level so you can see exactly where in the hierarchy each change occurred.

No. All diffing happens in your browser using JavaScript. Your JSON never leaves your machine.