About the JSON Compare
Paste two JSON documents to see exactly what differs. Every added, removed and changed value is listed with its path, and key order doesn't matter.
Key features
- Structural diff: compares data, not text
- Key order is ignored automatically
- Lists every added, removed and changed value
- Shows the exact JSONPath of each difference
- Side-by-side original and modified values
- Both documents stay in your browser
What is JSON Compare?
JSON Compare is a structural diff for JSON. Instead of comparing two blocks of text line by line, it parses both documents and walks through them value by value. You get a clear list of what was added, removed or changed, each with the JSONPath where it happened.
That means formatting differences, indentation and the order of keys inside objects are ignored. Two documents that contain the same data are reported as identical, however differently they're written.
Example
Original
{ "name": "Ada", "role": "editor", "city": "London" }
Modified
{ "city": "Cambridge", "name": "Ada", "role": "owner", "team": "core" }
Result
| Path | Change | Original | Modified |
|---|---|---|---|
$.role | changed | "editor" | "owner" |
$.city | changed | "London" | "Cambridge" |
$.team | added | "core" |
Notice that the different key order made no difference.
When to compare JSON
- API regression testing. Compare responses before and after a deployment.
- Config drift. Spot differences between staging and production settings.
- Debugging. Find out exactly what a request changed in a stored record.
- Data migration. Verify that transformed records still contain the expected values.
- Code review. Understand changes to large fixtures or snapshot files.
Understanding the change types
- added: the path exists only in the modified document.
- removed: the path exists only in the original document.
- changed: the path exists in both but the value or type differs.
When a whole object is added or removed, it's reported once at its own path rather than once per nested field, which keeps the list short.
Tips for cleaner diffs
- Remove noise first. Volatile fields such as timestamps or request IDs always differ. Delete them, or run both sides through the JSON Cleaner.
- Watch array order. If arrays contain the same items in a different order, sort them in your code before comparing.
- Check types.
"42"vs42is a genuine difference that often causes bugs.
Related tools
View either document as a tree in the JSON Viewer, or sort keys for a readable text diff with the JSON Sorter.
How to use the JSON Compare
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.