Practical guide
Compare JSON by Structure and Value
By MultiZest · Updated
How to use this tool
- Paste the original and updated JSON, or load an original JSON file and paste the other version.
- Compare and inspect the change count and table.
- Open the complete output to copy or download the JSON comparison report.
Worked example
Changing {"enabled":false} to {"enabled":true} reports a changed value at /enabled. Reordering the properties of an object without changing their values reports no differences.
Objects and arrays are compared differently
Object properties are compared by key, so whitespace and property ordering are ignored. Arrays are compared by index; inserting an item at the beginning can produce multiple changed positions. The tool does not infer moved objects or match array records by ID.
Paths use JSON Pointer escaping: / inside a property name becomes ~1 and ~ becomes ~0. An empty path represents the root value. The exported report is not an executable JSON Patch.
Use valid data within the limits
Each input is capped at 500,000 characters, with at most 40,000 combined values, 60 nesting levels and 2,000 reported changes. Invalid JSON receives a side-specific error.
Integers outside JavaScript’s exact range must be quoted. Duplicate JSON property names follow normal JSON.parse behavior, which keeps the last value; validate the source separately if duplicate keys are significant.
Compare the structure instead of the formatting
Two API responses can have the same object values while listing their keys in a different order. A text diff may show many moved lines, while a structural comparison can focus on added, removed and changed values. Use that distinction when reviewing a response before and after an application update.
Arrays are different: their order can describe a ranking, a sequence of steps or a chronological list. This comparison preserves array order rather than assuming two arrays contain the same information merely because the values appear somewhere in both. Confirm what order means in your own data model.
Review changes by their paths and types
A difference at a nested path tells you where to investigate, not whether the change is desirable. Check whether 10 became "10", a value became null, or a required property disappeared. Those distinctions can affect validation and calculations even if the rendered user interface looks unchanged.
Use representative responses containing empty arrays, optional fields and nested objects. JavaScript parsing can round large numeric identifiers or collapse duplicate object keys before comparison, so quote exact identifiers in the original JSON. For an automated release gate, validate the results using the application’s schema and tests as well.
Questions and troubleshooting
Do different indentation and key order cause differences?
No. JSON is parsed before comparison. Object key order and whitespace do not matter.
Does this compare arrays as unordered sets?
No. Arrays are compared by position, so order matters.
Why does changing the order of an array produce differences?
Array order is part of the structure being compared. If your application treats an array as an unordered collection, normalize it deliberately before comparison using that application’s own rules.
Continue with a related tool
Format, minify, and validate JSON data with readable output and syntax error messages.
CSV ↔ JSON Converter →Convert CSV and JSON with quoted-field support, custom delimiters, preserved text values and spreadsheet formula protection.
Text Diff Checker →Compare two text versions and display added and removed lines with clear plus and minus markers.
Sources and further reading
Found an error or an unclear instruction? Report it. Read our editorial policy and privacy policy.