Run an RFC 6902 patch on a JSON document and see which operation fails, if any
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 17 Oct 2026.A JSON Patch either applies cleanly or fails as a whole, and the error from a server rarely says which of 20 operations broke. Paste the document and the patch: the patched document appears at once, or the message names the failing operation by number, such as "Operation 2 (remove /b): /b does not exist". All 6 operations are supported, including test, move and copy.
Paste or type your input.
Choose the options you need.
Press Ctrl+Enter, then copy or download.
REST APIs use PATCH requests to change part of a resource without resending all of it. The body is usually one of two standard formats, and getting either one exactly right by hand is fiddly. This page writes them for you and tests them before they reach a server.
| Mode | You paste | You get |
|---|---|---|
| Create patch | Original and changed document | An RFC 6902 JSON Patch |
| Apply patch | Original and a JSON Patch | The patched document, or the failing operation |
| Create merge patch | Original and changed document | An RFC 7386 merge patch |
| Apply merge patch | Original and a merge patch | The merged document |
How patches are applied. Operations run in order on a copy; if any fails, nothing is applied and the error gives the operation number, its path and the reason. The test operation compares by value, so key order does not matter, while a leading zero in an index such as 01 is rejected, as the specification says.
The rest of the article, and all 6 questions about JSON Patch Generator and Tester, are on the JSON Patch Generator and Tester page.
JSON Patch (RFC 6902) is a list of operations such as add, remove and replace, each with a path, so it can change array items and set values to null. JSON Merge Patch (RFC 7386) is a partial document: keys to change, null for keys to delete. Merge patches are simpler; JSON Patch is more precise.
Paste the original document on the left and the changed one on the right with Create patch selected. The page compares them key by key, matches array items by their longest common run, and writes the add, remove and replace operations. Applying the result to the original gives the changed document exactly.
Each path must already exist, except the last part of an add. A missing parent key, an array index past the end, an index with a leading zero such as 01, or a key containing a slash not written as ~1 makes the whole patch fail. The message names the operation number and the path.
A path ending in - refers to the position after the last array item, so an add operation with the path /tags/- appends its value to the tags array. Only add, and move or copy as a target, accept -; the other operations need a real index from 0 upward.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about JSON Patch Generator and Tester and anybody who knows can answer. No account needed.
Same job, other tools: TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON · JSON to YAML – Turn JSON into clean, readable YAML for configs · YAML Validator – Check YAML syntax and see the exact line and column of each error · Query String Parser – Split a URL query string into a table of decoded parameters.