JSON Merge Patch
Apply an RFC 7396 merge patch locally: update object fields, delete fields with null and replace arrays as whole values.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Preview an RFC 7396 Merge Patch on a JSON document, then download the complete result. Import or paste the original and patch separately.
How to use this tool
- Paste or import the original JSON and the Merge Patch JSON separately.
- Object members set to null are deleted; arrays and other nonobject values replace the target.
- Review deleted keys, whole-array replacements and the complete result before downloading. Use JSON Patch for indexed array edits.
Supported inputs and limits
A null patch member deletes an existing object key. Existing arrays are replaced as whole values; an array element cannot be patched by ID. A nonobject patch replaces the entire document.
Each UTF-8 JSON input is limited to 1 MiB. The page lists up to 20 deletion and array-replacement paths of each kind; the downloaded result contains the full JSON. No HTTP PATCH request is sent.
Worked example
Example input
{"name":"Ada","note":"old","roles":["read"]}
Merge Patch JSON:
{"note":null,"roles":["write"]}Example options
{}Example output
{
"name": "Ada",
"roles": [
"write"
]
}When something does not work
Correct either JSON document's syntax or duplicate keys, and keep each UTF-8 input under 1 MiB. Check the complete result before saving.
Frequently asked questions
How are null values and arrays handled?
A null patch member deletes an existing object key. An array patch replaces the entire array; a nonobject root patch replaces the whole document.
What should the example produce?
name remains Ada, note disappears and roles becomes ["write"]. Retain the original document for rollback.
Which cases are outside its scope?
Merge Patch cannot target one array element by index or ID, and it does not send an HTTP request. Use JSON Patch for indexed edits.
Documentation & further reading
Related tools
JSON formatter and string tools
Format or minify JSON, sort object keys, or convert between plain text and a JSON string.
JavaScript regex tester
Test JavaScript patterns against text and inspect matches, positions and capture groups.
Compare text
Compare two texts line by line, with a side-by-side view of changes.
HTML formatter
Format HTML source with consistent indentation and review the result as text.