How it works
Each side is parsed on its own, as in the formatter: a leading byte-order mark is ignored and a stray no-break space is named in the error under the box. The validity badges follow every keystroke, but the comparison runs 150 milliseconds after typing pauses, since walking two large documents per keystroke is what makes a page stutter. The walk is recursive: identical values are equal, an object against an array or a number against a string is a type change, and two objects are compared over the union of their keys, with a key present on one side only reported as added or removed down to its last leaf.
Arrays are lined up before they are compared. Every item is reduced to a canonical string — its JSON with keys sorted — and the two lists are aligned with a longest-common-subsequence table once matching items at both ends have been settled. A stretch of removed items followed by added ones is paired off in order, so an item edited in place is compared with its counterpart and the changes inside it show at their own paths. The aligned reading is kept only when it reports fewer changes than a plain index-by-index comparison; on a tie, or when the table would exceed four million cells, the positional reading is used.
The result is one tree drawn three ways. Side by side renders it twice with identical rows, so collapsing a branch collapses it in both panes and the scroll positions mirror each other; containers with more than 200 entries start collapsed. Inline merges both sides into one list. Changes only flattens the tree to the leaves that differ, each with its path: dot notation for plain keys, brackets for keys with spaces or dots and for array indexes, which are the item’s index in its own document. Invisible characters are written as \uXXXX escapes, so two strings that differ only by a no-break space do not look identical.