JSON Diff — Compare Two JSON Objects Online Free
Paste two JSON objects to compare them side by side and highlight every added, removed, and changed key.
What is JSON Diff?
A JSON diff compares two JSON documents and identifies exactly what changed: keys added, removed, or modified. Unlike a plain text diff, a JSON diff understands object structure — reordering keys does not produce false differences, and nested objects are compared recursively. This free online JSON diff tool highlights every change in green (added), red (removed), and amber (changed), making it instant to review API response changes, config drift, or data migration output. Everything runs in your browser — no data is ever sent to any server.
When to Compare JSON Files
- API development — compare response payloads before and after a code change to verify no fields were accidentally dropped
- Configuration management — audit config file differences between environments (dev, staging, production)
- Data migration — validate that a data transformation preserved all fields correctly
- Debugging — compare two runs of a process to find what changed in the output
- Webhook auditing — track how a third-party webhook payload has evolved over time
How to Compare JSON Programmatically in Python
For code-level JSON comparison in Python, use the deepdiff library:
from deepdiff import DeepDiff
import json
a = json.loads(json_string_a)
b = json.loads(json_string_b)
diff = DeepDiff(a, b, ignore_order=True)
print(diff)
How to Compare JSON in JavaScript
// Simple deep equality check
JSON.stringify(a) === JSON.stringify(b);
// For a detailed diff, use the json-diff or deep-diff npm package
import { diff } from 'deep-diff';
const changes = diff(objectA, objectB);
Before comparing, make sure both JSON objects are valid using the JSON Validator. To format the JSON for easier reading, use the JSON Formatter.
Frequently Asked Questions
What does JSON Diff show?
It shows keys that were added (+), removed (−), or changed (~) between the source and target JSON. It performs a deep recursive comparison, including nested objects and arrays.
What is JSON diff used for?
Common uses: comparing API responses before and after a change, reviewing config file differences, debugging data transformations, and auditing JSON migrations.
Does key order matter?
No. JSON object keys are unordered by spec. This tool compares by key name, not position, so reordered keys are not flagged as differences.
How do I compare two JSON files in Python?
For a simple equality check: json.loads(a) == json.loads(b). For a detailed diff showing what changed, use the deepdiff library: DeepDiff(a, b, ignore_order=True).
What is the difference between a JSON diff and a text diff?
A text diff compares line by line — reordering keys or changing indentation produces false differences. A JSON diff understands the data structure, so it compares values by key name and handles nesting correctly. This makes JSON diff much more useful for comparing API responses or config files.
Can I compare JSON arrays?
Yes. This tool compares JSON arrays element by element. Array order matters — an element at index 0 is compared against the element at index 0 in the other JSON. If array order is not significant in your use case, sort the arrays before comparing.