How to Compare Two JSON Objects and Spot Added, Removed and Changed Keys
Learn how to paste two JSON payloads side by side and get a color-coded list of keys that were added, removed or modified between them.
JSON Diff & Compare
Introduction
Comparing API responses or config files by eye is slow and misses small value changes. The JSON Diff & Compare tool parses two JSON objects and lists every top-level key that was added, removed or modified, with each change color coded. Parsing and comparison run in the browser.
Step-by-Step Instructions
- Paste the earlier payload into the Original JSON (A) box.
- Paste the newer payload into the New JSON (B) box.
- Read the Difference Output panel, which recalculates on every edit.
- Scan the colors: green lines are added keys, red lines are removed keys and amber lines are modified values.
- Fix any Error parsing JSON message by correcting the quoted side, since both inputs must be valid JSON.
Key Use Cases
- API regression: Compare a response captured before a deploy with one captured after to see which fields changed.
- Config drift: Check which settings differ between a staging and production configuration export.
- Version review: Confirm a package manifest only changed the version field and nothing else.
Frequently Asked Questions
Does it diff nested objects key by key?
The comparison walks the top-level keys only. A nested object or array is compared as a whole by serialising it, so any change inside it is reported as one Modified line for the parent key, showing the old and new values in full.
Does key order or whitespace matter?
No. Both sides are parsed with JSON.parse, so indentation, line breaks and key order have no effect. Only the keys present and their values are compared, and two objects with identical content report that they are identical.
What input does the tool expect?
Each box must contain valid JSON. Trailing commas, single quotes or comments cause a parsing error for that side, and the error message from the parser is shown in the output panel. The tool is designed for objects at the root; a root-level array is parsed but compared by index as if indices were keys.