JSON Merge Patch Tool
Apply an RFC 7386 JSON Merge Patch to a document, or work backwards and generate the minimal merge patch between two documents. Shows the patched result plus a per-key list of what was added, replaced and removed — all in your browser.
Input
Set a key to null to remove it. Arrays and non-object values replace whatever they land on.
Options
Output
The patched document in Apply mode, or the generated merge patch in Generate mode.
| Operation | Path | New value |
|---|---|---|
| No data yet | ||
Guides
Apply an RFC 7386 JSON Merge Patch to a document and see the result — or work backwards from a before-and-after pair and get the minimal patch that turns one into the other. Both directions run in your browser, and both show a per-key list of what actually changed.
How to use it
- Pick a Mode. Apply takes a document plus a patch and produces the patched document. Generate takes the original and the modified document and produces the patch you would
PATCHto an API to make that change. - Paste JSON into the two boxes. The result updates as you type.
- Copy or download the Result, and check the Changes table to confirm the patch does what you expected.
RFC 7386 in four rules
Merge Patch is deliberately simpler than JSON Patch (RFC 6902) — it is just a sparse copy of the document, not a list of operations:
nullremoves a key.{"phoneNumber": null}deletesphoneNumber. The flip side is that a merge patch can never set a value to null — that is the format's one real limitation.- Objects merge recursively.
{"author": {"familyName": null}}touches onlyfamilyNameand leavesgivenNamealone. - Arrays are replaced whole. There is no way to append to or edit one element of an array; you send the entire new array.
- A non-object patch replaces the document. If the patch is
["a"]or42or a string, that value becomes the entire result.
Settings
Output indentation — 2 spaces, 4 spaces, tabs, or minified. Minified is the one to pick when you are pasting the patch straight into a request body.
Which mode do I want?
If you have a patch and want to know what it would do, use Apply. If you have edited a config or a resource and need the PATCH body to send, use Generate — it emits the smallest patch that produces your modified document, including a null for every key you removed.
Merge Patch or JSON Patch?
Use Merge Patch (application/merge-patch+json) when your changes are ordinary field updates and deletions — it is far easier to read and write. Use JSON Patch (application/json-patch+json) when you need to modify individual array elements, set a value to null, or express test/move/copy operations.
Is my data uploaded?
No. Everything is parsed and patched locally in your browser, so API payloads and config files never leave your machine.
Related tools
To see a full structural diff between two JSON documents rather than a patch, use JSON Compare. To address a single value inside a document by path, use the JSON Pointer Evaluator, and to tidy or validate the JSON you are about to patch, use the JSON Formatter.