{ }jsonkit
Tools/Validate/JSON Patch / Merge Patch
Search tools…⌘K
Format
{ }JSON Formatter
≡→JSON Minifier
\"JSON Escape / Unescape
a→zJSON Sorter
⇄{}JSON Flattener
Validate
JSON Validator
±JSON Diff / Compare
§JSON Schema Generator
JWT Decoder
ΔJSON Patch / Merge Patch
kbJSON Size Analyzer
Convert
→csvJSON to CSV
csv→CSV to JSON
⇄ymlJSON ⇄ YAML
⇄xmlJSON ⇄ XML
→tsJSON to TypeScript
b64Base64 Encode / Decode
%2FURL Encode / Decode
clkTimestamp Converter
→zJSON to Zod
→pyJSON to Pydantic
→goJSON to Go
→javaJSON to Java
⇄jsonlJSON ⇄ JSONL
5→JSON5 / JSONC to JSON
Query
$.JSONPath / JQ Tester
.*Regex Tester
Generate
Mock JSON Data Generator
idUUID / NanoID Generator
#Hash Generator
Δ

JSON Patch / Merge Patch

Generate and apply RFC 6902 JSON Patch and RFC 7386 merge patches.
processes as you type · client-side
Sample
Upload
Mode
Gen mergeApply mergeGen patchApply patch
⧉ Copy output ⌘C
Download
Share
Clear
JSON A (original)219 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
JSON B (target / patch)167 B · paste or drop a file
1 2 3 4 5 6 7 8 9 10
Result
codetree
1 2 3 4 5 6 7 8 9 10
{ "age": 37, "address": { "city": "London", "zip": "SW1A 1AA" }, "id": null, "active": null, "plan": null }
✓ valid (RFC 8259)219 B → 127 B0.0 msLn 1, Col 1UTF-8

About JSON Patch / Merge Patch

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.

How it works

Four modes: generate or apply, merge or patch

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.

Merge patch (RFC 7386): compact and readable

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.

JSON Patch (RFC 6902): explicit ordered operations

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.

Array handling when generating a 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.

Frequently asked questions

What is the difference between JSON Patch and JSON Merge 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.

How do I apply a JSON Patch to a document?

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.

Does null delete a key in a merge patch?

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.

Is my JSON uploaded anywhere?

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.

Why does my generated patch replace the whole array?

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.