This tool works with the two standard ways to describe a change to a JSON document: JSON Merge Patch (RFC 7386) and JSON Patch (RFC 6902). Paste an original document as A and a target as B to generate the patch that turns one into the other, or paste a document plus a patch and apply it. It covers all four directions from a single mode switch.
Everything runs in your browser in plain JavaScript. Neither document is uploaded, logged or sent to a server, so it is safe for production payloads, config files and anything with tokens or customer data in it. There is no signup, no size paywall and no Pro tier — it is free and works offline once the page has loaded.
Merge patches are compact and human-readable — they look like the target with only the changed keys, and a null value means delete a key. JSON Patch is an explicit ordered list of add, remove, replace, move, copy and test operations addressed by JSON Pointer, which is what APIs expect in an HTTP PATCH body. Use merge patch when you want something readable, and JSON Patch when you need precise, ordered, array-aware operations.
The mode switch has Gen merge, Apply merge, Gen patch and Apply patch. In the generate modes, A is the original and B is the target document. In the apply modes, A is the document and B is the patch to apply. The output is always pretty-printed JSON: the generated patch, or the resulting document.
A merge patch mirrors the shape of your object and only lists keys that changed; a null value deletes that key. Nested objects are merged recursively. Because it cannot express deleting an array element or setting a value to null on purpose, it is best for simple, readable config-style updates rather than precise array edits.
A JSON Patch is an array of operations — add, remove, replace, move, copy and test — each targeting a location with a JSON Pointer (RFC 6901). Pointers support the ~1 and ~0 escapes for slashes and tildes in keys, and the - token appends to an array. The apply mode runs the operations in order and a failing test stops the patch.
When generating a JSON Patch, objects are diffed key by key, but if two arrays differ in any way the tool emits a single replace of the whole array rather than per-element add and remove operations. This keeps generated patches predictable and correct; if you need element-level array ops, write them by hand and use Apply patch.
JSON Merge Patch (RFC 7386) is a compact document that looks like your target and only lists changed keys, with null meaning delete. JSON Patch (RFC 6902) is an explicit ordered list of add/remove/replace/move/copy/test operations addressed by JSON Pointer. Merge patch is more readable; JSON Patch is more precise and better for arrays.
Choose Apply patch, paste the document into A and the patch array into B. The operations run in order and the resulting document is shown. Choose Apply merge to apply an RFC 7386 merge patch instead.
Yes. In JSON Merge Patch a key set to null in the patch deletes that key from the target. That is also why merge patch cannot set a value to null on purpose — use JSON Patch with a replace operation for that case.
No. All generating and applying happens locally in your browser with JavaScript. Neither document is uploaded, logged or sent to a server, so it is safe for production data, and it keeps working with your network disconnected.
When generating an RFC 6902 patch, this tool replaces an entire array whenever it changes rather than computing element-level add/remove operations. This keeps the output correct and predictable. If you need per-element array edits, write those operations by hand and use Apply patch.