What it does
Put a document in each box, Left and Right, and they are compared as you type. Differences are read from Left to Right: what only Left has is removed, what only Right has is added, and the patch turns Left into Right.
The four views
- Documents: the two boxes, to type, paste, drop a file on, or open one into.
- Side by side: both documents, line by line. What only one side has is red on the left or green on the right with a blank on the other side, and what changed is amber with the characters that differ marked. The strip at the right edge has a tick for every difference.
- Changes: a list of every addition, removal and change, each with the JSON Pointer to it. Click one to copy the pointer.
- Patch: the same differences as an RFC 6902 JSON Patch, one operation to a line.
What is not a difference
The members of an object have no order, so a document with its keys sorted is the same document. Numbers are compared by value with their exact digits: 1, 1.0 and 10e-1 are one number, while two 30-digit integers that differ in the last digit are two. Arrays are ordered, but they are aligned by content first, so a value put in at the start of a long array is one addition and not a change to every element after it.
Moving a difference
Between the two sides each difference has two arrows, one over the other, at its first line: the upper one moves it into the left document (Left takes what Right has there), the lower one into the right document. A difference that is taller than the window keeps its arrows at the top of what is in view.
A click on a line picks it, and then an arrow moves only the lines that are picked, not all of the difference. Ctrl (⌘ on a Mac) adds a line, or takes it away if it is picked, Shift picks everything from the line clicked last, dragging over lines picks them, and Esc, or a click on a line that is the same on both sides, lets go of them. A value is picked whole, whatever its lines. ◀ and ▶ over the comparison (Alt+←, Alt+→) move the lines that are picked, or, when none is, the difference that ▲ and ▼ (Alt+↑, Alt+↓) went to.
The document that changed is written back into its box and the comparison runs again. The view stays where it was, nothing is picked, and ▼ goes on to the next difference, from the top of what is in view, when you want it. The document is marked (changed) until it is saved: Save over each side downloads it, as the file it was read from, or as left.json or right.json. Differences only folds what is the same.
Typing over a line
A double click on a line, on either side, puts a caret in it. Type, and press Enter or click somewhere else to put it in; Esc puts the line back. What is typed takes the place of the member or the element that was on the line, and has to be JSON where it is: a value, "name": value, nothing (the line goes), or several with commas between (they are all put in). On a line that opens an object or an array only the name can be changed. If it is not JSON, the page says what is wrong and keeps the line to be put right. A line that closes an object or an array, the first line of a document, and a line that was cut short (over 400 characters) have no caret; the Documents view has all of those.
The change is made to the document itself, not to the lines on the screen: the members of the right document stay in the order it has them (the view shows both in the order of the left one), and a number keeps the way it was written.
In your tab
The comparison is made by the same Rust engine as the desktop app, compiled to WebAssembly: nothing is uploaded. This page takes up to 10 MB a document; the desktop app compares up to 128 MB at a time. To apply the patch to a document, use Patch.