JSON Diff and Patch

Paste two JSON documents. The page lists each value that was added, removed or changed, with its path, and writes an RFC 6902 JSON Patch that turns the left document into the right one.

Free Runs in your browser Checked Tuesday, November 10, 2026

The first document, usually the old version. Its values are the 'before' of each change.

The second document, usually the new version. Its values are the 'after' of each change.

Compares arrays as collections, so an item that only moves is not a change.

Result

Number of differences — Added, removed and changed values together.
Validity — Whether both texts are valid JSON, or which one is not.
Summary —
Patch check — Applies the patch to the left document in the browser and compares the result with the right document.
JSON Patch (RFC 6902)
Differences

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Paste the old JSON into Left JSON and the new JSON into Right JSON.
  2. Tick Ignore the order of array items if the arrays are sets, such as lists of tags.
  3. Read the Differences table. Each row gives the Path (JSON Pointer) of the value, and copy the JSON Patch when Patch check says it applies.

How the documents are compared

The two documents are compared by value. The order of the names in an object does not matter, because JSON defines an object as a set of members. The order of the items in an array does matter, unless you tick the option, since an array is an ordered list.

Numbers are compared as numbers, so 1 and 1.0 are equal. RFC 8259 section 6 says that integers from -(2^53)+1 to (2^53)-1 are read the same by every implementation, and a longer integer may be rounded when it is read.

Paths and the patch

A path is a JSON Pointer (RFC 6901): each step is a name or an index, separated by a slash. The first item of the list tags is /tags/0, and the empty path is the whole document. A slash inside a name is written ~1, and a tilde is written ~0.

The JSON Patch (RFC 6902) uses three operations: add, remove and replace. Removed array items are taken away from the last one backwards, so that each index is still right when it is used, and added items are appended with the index "-", which RFC 6902 defines as the end of the array.

Ignoring the order of arrays

With the option ticked, items are matched by their value, whatever their position. Items that have no partner are reported as added or removed. An array that differs is replaced whole in the patch, because a patch that only moves items would need to know how they moved. The patch then gives the array in the order of the right document.

Worked example: the default documents

The left document has the name FireToolLand, version 1, the tags json and csv, and free set to true. The right document has version 2, the tags csv, json and yaml, and a license of null. Read in order, the differences are six: version, the two changed tags, the added yaml tag, the removed free and the added license.

With Ignore the order of array items ticked, the tags are the same two items in another order, so the only tag difference is yaml, and the count drops to four.

Result Default texts Order ignored
Number of differences 6 4
Summary 2 added, 1 removed, 3 changed. 2 added, 1 removed, 1 changed.

Frequently asked questions

Why does the order of array items matter?

In JSON an array is an ordered list, so [1,2] and [2,1] are different data. Tick Ignore the order of array items when the array is a set, such as a list of tags or permissions.

What does a path such as /tags/0 mean?

It is a JSON Pointer (RFC 6901): the member tags, then its first item, because indexes count from 0. The empty path means the whole document, and a name that contains a slash is written with ~1 in its place.

Are 1 and 1.0 the same value?

Yes. Both are the number one, so the page reports no difference. Integers larger than 2^53 can be rounded by a JSON parser, so compare long identifiers as text instead.

What is a JSON Patch used for?

It is a list of steps (RFC 6902) that a server or a library applies to one document to get another, for example to update a stored settings file. The patch check shows that the steps give the right document.

Why is a whole array replaced when the order is ignored?

With the order ignored, a changed array has no single step that turns it into the right one without knowing how its items moved. The patch therefore writes the right array in full.

Is my JSON sent anywhere?

No. Both texts are read and compared in your browser, and nothing you paste is sent to our server or stored there.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.