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 every value that was added, removed or modified, with its full path.
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 documents, walks them recursively and lists every value that was added, removed or modified, with its path and a color code. 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?
Yes. The comparison recurses into nested objects and arrays and reports each change with a path such as settings.theme or items[2].price. Object keys are matched by name, array items by position, and a value whose type changes, such as an array replaced by an object, is reported once as Modified at that path.
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. Any JSON value works at the root: objects, arrays, and even bare values such as 5 and 6, which are reported as a modification.