Back to all tools
JSON Diff Online
Validate, format, sort, and compare JSON objects and API responses.
●Processed locally in your browser
Added
1
Removed
0
Modified
0
Valid
✓
Comparison Result
1 change detected:
ADD /tools/2: "json"
How to Compare JSON
- 1. Paste JSON: Enter your JSON objects in the left and right panes.
- 2. Validate: Invalid JSON will show an error message. Use Format to auto-fix indentation.
- 3. Sort Keys: Enable "Sort keys" to alphabetically order object keys before comparison (arrays stay in order).
- 4. Compare: View added, removed, and modified counts.
- 5. Copy Results: Use Format/Minify buttons or copy the comparison output.
Supported JSON Types
Objects
Arrays
API Responses
Config Files
Key Features
JSON Validation
Automatically detects and reports parsing errors with clear error messages.
Format & Minify
Pretty-print with 2-space indentation or compact to single-line JSON.
Sort Keys
Alphabetically sort object keys recursively for easier comparison. Arrays maintain their order.
FAQ
What happens if my JSON is invalid?
The tool shows which side failed to parse and displays a readable error message so you can fix the JSON.
Does sorting keys change values?
No. Sorting only changes object key order to make comparisons easier. Values, arrays, booleans, and numbers remain unchanged.
Can I compare API responses?
Yes. Paste two JSON API responses, format them, optionally sort keys, and compare the structural differences.