How to Compare Two JSON Inputs for Structural Differences
Enter two JSON values in the optional inputs and start the comparison. The result indicates whether their parsed structures match and reports detected structural differences when they do not.
Understand the comparison
JSON Diff compares two JSON inputs after parsing them into data structures. It is useful when you need to check whether two responses, configuration values, or saved snapshots represent the same structure. Because the comparison includes nested objects and arrays, a change can be identified below the top level instead of being overlooked in a large document.
This approach is different from comparing two documents as ordinary text. The result focuses on JSON properties, values, array lengths, and corresponding array positions. You can provide a complete object, an array, or another valid JSON value in each input. Both fields are optional, but an empty field has a specific result that should not be mistaken for two matching JSON values.
Compare the two inputs
- Prepare the two JSON values you want to examine. For a meaningful comparison, make sure each value you intend to use is valid JSON. Property names and string values need quotation marks, arrays need matching brackets, and objects need matching braces.
- Place the first JSON value in the first text input and the second value in the other input. The fields accept JSON text independently, so the values can come from separate responses, configurations, or snapshots.
- Start the comparison after both intended inputs are present. The tool parses the supplied values and compares their resulting structures, including objects or arrays nested inside larger values.
- Read the identity result before reviewing individual findings. A successful comparison indicates whether the parsed inputs are identical. When differences are found, the result also provides their count, which helps you judge how many reported changes need attention.
- Examine the findings to locate the change. Depending on the inputs, the report can identify an object property that was added or removed, a changed value, an array-length change, or a difference between corresponding positions in an array.
- If parsing information appears with an unsuccessful result, inspect the nonblank input identified by that information. Correct its JSON syntax and run the comparison again. A parsing failure does not provide a structural difference report.
- Check for empty or whitespace-only content before relying on a successful result. If either field has no substantive text, the tool returns successfully with no reported differences while indicating that the inputs are not identical. Add the intended JSON and compare again when the blank field was accidental.
- Record the property, value, array position, or difference count that matters to your review. The report describes detected changes; it does not create a merge, patch, correction, or recommendation for resolving them.
Interpret the result
An identical result means that the two valid inputs produced matching parsed structures. This conclusion concerns the structures represented by the JSON, not a visual reading of the two input areas. When the result is non-identical, use the findings and their count to determine whether the cause is a changed value, an object property added or removed, an array-length change, or a mismatch at a corresponding array position.
A successful result with no reported differences needs additional care when one field was empty or contained only whitespace. In that situation, the tool indicates that the inputs are not identical even though it lists no differences. Replace the unintended blank content with the JSON you meant to examine before treating the result as a comparison of two supplied values.
An unsuccessful result accompanied by parsing error information has a different meaning from a non-identical comparison. It indicates that a nonblank input could not be parsed as JSON, so the structural comparison was not completed. Correct the syntax and submit both values again to obtain a structural result. Keep the scope in mind when sharing the outcome: this tool compares parsed JSON structures and does not decide how a detected difference should be fixed.
Worked example
You are checking whether a configuration snapshot changed from a draft status to a published status.
Paste {"status":"draft"} into one input and {"status":"published"} into the other, then start the comparison.
The result indicates that the parsed inputs are not identical, reports a changed value for the status property, and includes a difference count.
Limitations
- The comparison applies to parsed JSON structures rather than general text, and it does not produce a merge, patch, correction, or resolution recommendation.
Common errors
- Cause: a nonblank input contains malformed JSON, such as an unquoted property name or an unmatched bracket. Correct the syntax in the input identified by the parsing information, then submit both values again.
FAQ
Does JSON Diff compare nested objects and arrays?
When both inputs contain valid, non-whitespace JSON, the comparison examines nested objects and arrays as parts of the parsed structures, rather than stopping at top-level properties.
What happens if one JSON input is blank?
If one field is empty or contains only whitespace, the tool returns successfully with no reported differences while indicating that the inputs are not identical. Add the JSON you intended to compare before interpreting the outcome.
What happens when the JSON is invalid?
When a nonblank value cannot be parsed as JSON, the result is unsuccessful, includes parsing error information, and reports no differences. Fix that value's syntax and start the comparison again.