JSON Patch Generator (RFC 6902 diff)

Paste an original and a changed JSON document and get a JSON Patch array of add, remove and replace operations that transforms the first into the second.

Use the tool

Why this tool exists

JSON Patch lets an API send only what changed, instead of a whole document. Writing the operations by hand for a nested object is tedious and easy to get wrong, especially paths with escaped slashes or arrays where items shift.

This generator walks both documents and produces a patch with RFC 6901 paths. Objects are compared by key, arrays by position, and a changed leaf becomes a replace. It does not detect moves or copies, so an item that moved appears as a remove plus an add, and a reordered array becomes several replaces. The result is correct but not always the shortest. Use the JSON Patch Applier to confirm that it reproduces your target.

How to use it

  1. Paste the original JSON in the first box.
  2. Paste the modified JSON in the second box.
  3. Copy the generated patch, and test it with the applier tool.

Frequently asked questions

Does it create move or copy operations?

No. Only add, remove and replace are generated. A moved value shows up as removal at the old path and addition at the new one, which is still valid but longer.

How are arrays compared?

Item by item, by index. Extra items at the end of the original are removed, from the last backwards, and extra items in the new array are added. Inserting at the front changes many indexes.

What if the documents are the same?

The tool returns an empty array and states that they are identical. Key order inside objects does not count as a difference.

Will the patch work with any server?

It follows RFC 6902, so servers that implement it should accept it. Some APIs use a different partial-update format, such as JSON Merge Patch, which this tool does not create.