JSON Patch (RFC 6902) Diff & Applier
JSONDiff two JSON documents into an RFC 6902 JSON Patch operation list, or apply a JSON Patch to a target document
JSON Patch (RFC 6902) describes a change to a JSON document as an explicit list of operations: add, remove, replace, move, copy, and test, each addressed by a JSON Pointer path. It is the format behind PATCH endpoints that need to express precise edits, including inserting into the middle of an array, something its simpler cousin JSON Merge Patch cannot do. This tool covers both directions. In diff mode it compares two documents you paste in and generates the patch that turns the first into the second, comparing arrays position by position rather than computing a true minimal edit distance. In apply mode it runs a patch you provide against a target document and shows the result, or tells you exactly which operation failed and why.
How to use JSON Patch (RFC 6902) Diff & Applier
- 1.Switch to Diff mode, paste a source and a target JSON document, and copy the generated RFC 6902 patch.
- 2.Switch to Apply mode, paste a target document and a patch operation array, and read the patched result below.
- 3.If a patch operation fails (a missing path, a failed test, an out-of-bounds array index), the error names the operation's index and the reason.
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/json-patch \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"mode":"diff","a":"{\"name\":\"Bob\",\"age\":30}","b":"{\"name\":\"Bob\",\"age\":31}","target":"{\"name\":\"Bob\",\"age\":30}","patch":"[{\"op\":\"replace\",\"path\":\"/age\",\"value\":31}]"}'Get an API key from your dashboard · Full API docs →