JSON Patch Generator & Applier

Generate an RFC 6902 JSON Patch between two documents, apply a patch to a source, or run an RFC 7386 merge patch — entirely in your browser.

The JSON Patch Generator runs entirely in your browser. The documents and patches you paste are diffed and applied on your device and are never uploaded to ArrayKit.

Open the JSON Diff tool

About JSON Patch Generator

The JSON Patch Generator turns the difference between two JSON documents into a clean RFC 6902 operation array — the add, remove, replace, move, and copy steps that transform a source into a target. Switch to Apply mode to run a patch against a source document and see the exact result, with every operation validated so a bad op or a failed test is caught instead of silently skipped. A third mode applies RFC 7386 JSON Merge Patches, where a null value deletes a key and objects merge key by key. It is built for developers wiring up PATCH endpoints, syncing config, or reviewing API changes. Your source, target, and patch are processed on your device and never leave the browser.

Features

How to use the JSON Patch Generator

  1. Choose Generate to diff two documents, Apply patch to run an RFC 6902 patch, or Merge patch for RFC 7386
  2. Paste your source JSON on the left
  3. Paste the target document, patch array, or merge patch on the right
  4. Read the generated operations or the patched result, then copy or download it

Example

Input

source: {"active":true,"roles":["admin"]}
target: {"active":false,"roles":["admin","editor"]}

Output

[
  { "op": "replace", "path": "/active", "value": false },
  { "op": "add", "path": "/roles/1", "value": "editor" }
]

Generate produces the RFC 6902 operations that turn the source into the target.

Common errors & troubleshooting

Frequently asked questions

What is an RFC 6902 JSON Patch?
RFC 6902 is a format that describes changes to a JSON document as an ordered array of operations — add, remove, replace, move, copy, and test — each targeting a JSON Pointer path. Applying the array to the source produces the target.
How is JSON Merge Patch (RFC 7386) different from JSON Patch (RFC 6902)?
A merge patch is itself a JSON object that mirrors the target: present keys are set, a null value deletes a key, and arrays and scalars replace wholesale. It is simpler but cannot move values or edit individual array elements the way RFC 6902 operations can.
How do I generate a patch from two JSON documents?
Stay on Generate, paste the original on the left and the changed version on the right, and the tool computes the minimal RFC 6902 operation array. The diff ignores key order, so reordered fields do not create spurious operations.
Why did my patch fail to apply?
Operations are validated against the source. Common causes are a path that does not exist for remove or replace, a test operation whose value does not match, or an invalid op name. The tool shows the specific error so you can fix that operation.
Does a merge patch really delete a key with null?
Yes. In RFC 7386, a property set to null instructs the merge to remove that key from the result. To store an actual null you must use an RFC 6902 replace operation instead.
Are my JSON documents and patches uploaded anywhere?
No. The generator, the patch applier, and the merge-patch engine all run locally in your browser. Your source, target, and patch data are processed on your device and are never sent to ArrayKit.

Related tools

All ArrayKit tools