Structural diff vs text diff
A text diff — what git or a generic diff tool gives you — compares lines of characters. For JSON that is fragile: reorder two keys, change indentation from two spaces to four, or minify one side, and a text diff lights up every line even though the data is identical. A structural diff parses both documents first and compares the resulting values, so it answers the question you actually have: did the data change?
JSON Copilot walks both parsed documents together. Objects are compared key by key, regardless of the order the keys appear in the text. When a key exists on both sides, its values are compared recursively; when it exists on only one side, that is reported as an added or removed entry. Scalars — strings, numbers, booleans, null — are compared by value, and a value that changes type (say an object replaced by an id string) is reported as one changed entry rather than a cascade of noise.
The output is deliberately compact: one line per difference, prefixed ~ for changed, + for added, - for removed, with the full path and the values involved. Long values are truncated in the report so a single big blob does not drown out the list. Two structurally identical documents produce an explicit "No differences" result — a useful assertion in itself when you expected two payloads to match.