JSON diff vs text diff: what counts as a change?
The same two pastes can look different as text while containing the same JSON data.
A text diff compares written lines. A JSON diff parses both documents first and compares the resulting values. Use the distinction to decide whether you care about how a document was written or what data it contains.
JSON diff compares values
These documents have different line breaks and property order, but the same object data:
Original
{"name":"Ada","active":true}
Updated
{
"active": true,
"name": "Ada"
}
Diff Checker reports no JSON difference here. It ignores insignificant whitespace and object key order. The JSON specification describes objects as unordered and arrays as ordered. Array positions therefore still matter: changing ["red", "blue"] to ["blue", "red"] changes values at two indices in this checker.
Types matter too. 1 is a number, "1" is a string, and null is a different value from a missing property. A structural JSON diff can expose those changes even when the document is long.
Text diff compares lines as written
Plain text has no JSON structure to parse. The checker aligns matching lines and reports inserted, removed, or changed lines with their line numbers. In the example below, beta is added between two unchanged lines:
Original Updated
alpha alpha
gamma beta
gamma
Spaces and punctuation inside a line are content. hello world and hello world differ. This is useful for notes, logs, configuration snippets, or prose where the exact text matters. Different line-ending styles are normalized before line comparison, so a Windows CRLF and a Unix LF break at the same place are treated as the same line break.
How Diff Checker chooses
Paste both versions into Diff Checker and select Check differences. If both pastes are valid JSON, it compares values by path. If either paste is not valid JSON, it compares the text line by line. The result status says JSON or Text so you can see which method ran.
This matters when one document contains a syntax error. The checker still gives you a text diff; it does not silently repair invalid JSON. A quoted string such as "hello" is valid JSON, while bare hello is plain text.
How to read a changed JSON path
A result such as $.user.roles[1] starts at the root $, enters the user property, then roles, then the array item at index 1. Array indices start at zero, so that is the second role. The checker shows the original and updated values beside the path. This is its readable path notation; it is not a line number or a file path.