JSON Diff
Paste two JSON objects and compare them instantly. Added, removed, and changed keys are highlighted side by side.
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.