Developer Utility Tools

JSON Diff

Compare two JSON documents structurally: key order and formatting are ignored, array items can be matched by an id field, and the result is shown as a visual diff, a JSON Patch (RFC 6902) or a raw delta.

Private by design: anything you enter is processed in your browser only. It is never uploaded to or logged on our servers. Both documents are compared locally in your browser.

Examples:

JSON Patch

About JSON Diff

A plain text diff of two JSON files is noisy: re-ordered keys, different indentation or a reformatted file show up as changes even when the data is the same. This tool parses both documents and compares the data itself, so only real additions, removals and value changes are reported. It uses the jsondiffpatch library.

Arrays are the hard part. When an item is inserted at the top of a list, a position-by-position comparison reports every following item as changed. With Match array items by key field, objects are paired by the first field from the list (by default id, key, _id, uuid) they contain, so inserted, removed and re-ordered records are reported correctly. Switch to by position for arrays where the index itself is meaningful, such as coordinates or tuples.

The JSON Patch tab expresses the differences as an RFC 6902 list of add, remove, replace and move operations that turns the left document into the right one. You can send it in an HTTP PATCH request with the application/json-patch+json content type or apply it with any JSON Patch library. The Delta tab shows jsondiffpatch's own compact delta format, which can be applied or reversed with jsondiffpatch.

Comparing plain text or code instead? Use the text diff checker. To check that a document matches a contract rather than another document, use the JSON Schema validator.

Reference Guide

How changes appear in the JSON Patch output (paths are JSON Pointers; ~1 stands for / and ~0 for ~ in key names):

ChangeJSON Patch operation
New property or array item{"op": "add", "path": "/phone", "value": "+44 20 7946 0000"}
Removed property or item{"op": "remove", "path": "/address/zip"}
Changed value{"op": "replace", "path": "/name", "value": "Ada King"}
Array item moved (detect moves on){"op": "move", "from": "/products/2", "path": "/products/0"}

Operations are applied in order, so array indexes in later operations refer to the array after the earlier operations ran.

Frequently Asked Questions

Both documents are parsed first, so key order, indentation and line breaks are ignored and only real data changes are shown. For plain text or code, use the text diff checker.

By default, objects in arrays are paired by an id-like field (id, key, _id or uuid, configurable), so inserted, removed and re-ordered records are detected. Choose by position to compare items index by index.

JSON Patch (RFC 6902) is a standard list of add, remove, replace and move operations that transforms one JSON document into another. It is used with HTTP PATCH requests and supported by libraries in most languages.

Yes. Tick Hide unchanged values to collapse unchanged properties and see only the differences in the visual diff.

No. The comparison runs entirely in your browser.