JSON diff: compare two JSON documents by structure
Paste JSON into both boxes to see what changed.
Paste JSON into both boxes to see what changed.
This JSON diff tool compares two JSON documents by structure, not by line. Paste or upload the original on the left and the changed version on the right, and it lists every value that was added, removed or changed, with the JSON path to each one. Because it understands objects and arrays, a reformatted file or a reordered set of keys does not show up as a change.
Pick the view that suits the job. Changes is a flat list of differences with their paths, handy for review and for tickets. Side by side and Unified show both documents pretty printed with the differences marked, like a pull request, and fold the long unchanged stretches. You can ignore key order, array order, letter case and whitespace, and copy the result as plain text or as an RFC 6902 JSON Patch.
Added values are marked with a plus and removed values with a minus, in green and red, and changes carry a tilde, so the result reads without colour and works in light and dark themes. Everything runs in your browser. Your JSON is never sent anywhere or saved.
It reads both documents and walks them together, key by key and item by item. A key that exists on only one side is reported as added or removed, a value that differs is reported as changed, and a value whose type differs, such as a number that became a string, is reported as a type change. Each difference is given with its JSON path, for example $.users[2].email.
Not by default. Two objects with the same keys and values are equal whatever order the keys are in, which matches how JSON is defined. Untick Ignore key order if you want a change in key order reported too, for example when you compare files that are meant to stay sorted.
The items of each array are matched by value instead of by position, so [1, 2, 3] and [3, 2, 1] are equal. Leave it off for ordered lists, where position carries meaning. With it on, items that do not match exactly are paired by type, in the order they appear.
They only affect string values. Ignore case treats upper and lower case letters as the same. Ignore whitespace trims each string and treats any run of spaces, tabs and line breaks as one space. Keys are always compared exactly, and the values are shown as you wrote them.
JSON Patch is the standard format in RFC 6902 for describing changes to a JSON document as a list of add, remove and replace operations, each with a JSON Pointer path such as /users/2/email. Copy JSON Patch gives you the operations that turn the left document into the right one, ready for an API that accepts PATCH requests or a library that applies patches.
The tool says which box has the problem and shows the line and column of the error with a short reason, such as a missing comma or an unclosed string. Go to error puts the cursor on that spot. The diff appears as soon as both documents are valid.
Yes. Documents above a few tens of thousands of characters are compared in a background thread, so the page stays responsive. Long unchanged stretches are folded in the side by side and unified views, and the Changes view lists only what differs.
No. Both documents are parsed and compared in your browser and are never uploaded or stored. Only the option choices are kept in the page address.