JSON Merge Patch Generator
This tool generates a JSON Merge Patch per RFC 7396. Paste the before-and-after JSON documents and it compares them and outputs a merge patch you can send directly as an HTTP PATCH body. Only the changed parts are kept, so unchanged fields never appear in the patch. Comparison and generation run locally in your browser and nothing is uploaded.
How to use it
- 1
Paste the original JSON
Put the data as it was before the change on the left.
- 2
Paste the target JSON
Put the data as it should be after the change on the right.
- 3
Pause to generate
The tool outputs a merge patch containing only the differences and counts the operations; identical documents produce a "no changes" notice.
- 4
Copy and verify
Copy the patch as a PATCH request body, or switch to apply mode to verify its effect.
Key features
Only the differences
Unchanged fields are omitted from the patch, making it smaller and easier to read.
Deletions as null
Keys removed from the target are expressed as null in the patch, following RFC 7396.
No-change detection
When the two documents are identical the tool outputs an empty patch {} with a "no changes" notice.
Nested object diffs
Objects are diffed recursively so only the touched nested keys appear in the patch.
Worker-based local compute
Comparison and generation run on a background thread in your browser and the data is not uploaded.
Pairs with apply mode
Switch to apply mode on the same page to confirm that the generated patch reproduces the target.
Common errors & troubleshooting
- ! A merge patch expresses deletion with null, so it cannot express "set this key to null" — use JSON Patch for that case.
- ! Arrays are patched by whole replacement; a change anywhere inside an array makes the patch contain the entire new array.
- ! Verify a generated patch in apply mode against the original document to be sure it reproduces the intended target.
- ! Test a patch against a copy before sending it to a live endpoint.
Frequently asked questions
Can I use the generated patch directly?
Yes. The output follows RFC 7396 and can be used as a PATCH request body (Content-Type: application/merge-patch+json).
Why is a deleted field shown as null in the patch?
That is what RFC 7396 specifies — null means "delete this key".
Is my data uploaded?
No. Generation happens locally in your browser.
What does an empty patch {} mean?
It means the two documents are identical and there is nothing to change, so applying it leaves the target untouched.
Related tools
JSON Merge Patch
Apply an RFC 7396 JSON Merge Patch: keys in the patch overwrite the target, null deletes a key and a non-object patch replaces the target entirely. Simulates an HTTP PATCH. Runs locally.
JSON Patch
Generate and apply RFC 6902 JSON Patch. Diff two JSON documents into an add / remove / replace / move / copy / test operation sequence, or apply a patch to a target document. Runs locally.
JSON Diff / Compare
Compare two JSON documents side by side. Additions, deletions and changes are colour-coded, and key or array order can be ignored.
JSON Pointer
Resolve an RFC 6901 JSON Pointer such as /users/0/roles/1 against a JSON document. Returns the value at that node and its type, with ~0 / ~1 escaping handled. Runs locally.