Skip to content
Categories
JSON Diff
Compare two JSON values regardless of key order and display the structural differences.
Overview
- Compares two JSON values as data structures and highlights added, removed, and changed fields.
- Unlike Text Diff, JSON that differs only in key order is treated as having no difference, making this well suited for comparing API responses or config files where formatters often reorder keys.
- The comparison happens entirely in your browser.
Usage
- Enter the original JSON on the left and the JSON to compare against on the right.
- Click the "Compare" button.
- The structural differences are displayed (+: added, -: removed, unchanged parts are shown as-is).
Example
Input
Before:
{"name":"my-app","version":"1.0.0"}
After:
{"version":"1.1.0","name":"my-app"}Output
"name": "my-app", - "version": "1.0.0", + "version": "1.1.0",
Use Cases
- Comparing an API response before and after a change to see which fields were added, removed, or changed
- Checking the diff of a config file (like package.json) without being confused by reordered keys
- Verifying that an expected JSON value in a test matches the actual output
FAQ
What happens if the order of array elements changes?
Unlike object key order, the order of array elements is treated as meaningful data, so a change in order is detected as a difference.
How is this different from Text Diff?
Text Diff compares text line by line, so even a change in key order shows up as a difference. JSON Diff compares the data structure, so differences in key order are ignored.
Is the JSON I enter sent anywhere?
No. All comparison happens entirely in your browser.
Notes
- Both JSON values are validated for correct syntax before comparison. An error message is shown if either is invalid.
- Internally, both values are converted into a canonical form with sorted keys before comparison, so processing very large JSON may take some time.
Related Tools
Validate whether JSON is correctly formatted.
Convert JSON into YAML format.