JSON Patch Tool
Apply an RFC 6902 JSON Patch to a document, generate a patch from two documents, or apply an RFC 7386 merge patch, with clear errors for failing operations.
Free · No sign-up · Your inputs stay in your browser
Input
Apply or generate a JSON Patch
Output
Result
117 characters
A JSON Patch is applied all or nothing: a failing test operation leaves the document untouched, which is how optimistic concurrency is done with PATCH. A merge patch is simpler but cannot set a value to null (null means delete) or change one element of an array. kubectl patch --type=json and --type=merge take these two formats.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Which format
A merge patch is just the changed fields as JSON, with null meaning delete; it is easy to write but cannot set a value to null or change one item of an array. A JSON Patch (RFC 6902) is a list of operations addressed by JSON Pointer, and its test operation lets a client say "only if the value is still what I read", which is how optimistic concurrency works over PATCH.
Where you meet them
kubectl patch takes both with --type=json and --type=merge, many REST APIs accept application/json-patch+json, and JSON Pointer paths escape / as ~1 and ~ as ~0.