Apply JSON Patch online
Before you send a PATCH request, apply the JSON Patch to a copy of the document and confirm the result. RFC 6902 supports add, remove, replace, move, copy, and test.
Open the tool, then paste the sample input below. Everything runs locally in your browser.
The problem
A patch that looks right can still fail at runtime: a path may not exist, an array index may be off, or the body may not be a valid operation array. Applying it locally shows the transformed document and the exact operation that failed.
Sample input
{
"name": "Asha",
"status": "pending"
}
[
{ "op": "replace", "path": "/status", "value": "approved" }
]
Expected output
{
"name": "Asha",
"status": "approved"
}
The replace operation updates /status from pending to approved.
How to do it
- Paste the JSON document to patch.
- Paste the JSON Patch array.
- Apply the patch.
- Review the transformed JSON and any per-operation errors.
- Fix invalid paths, missing fields, or bad operations and re-apply.
Common mistakes
- Patch is a single object instead of an array of operations.
- An operation is missing
oporpath. - A JSON Pointer path is malformed (no leading
/, unescaped~or/). - A
removeorreplacetargets a path that does not exist. - An array index is out of range.
Related tools
Related guides
FAQ
What is JSON Patch used for?
Expressing changes to a JSON document as an ordered list of operations, commonly as the body of an HTTP PATCH request.
Can I apply JSON Patch locally?
Yes. The tool applies the patch in your browser and shows the resulting document without sending anything to a server.
Why is my patch failing?
The most common causes are a non-array body, a missing op or path, an invalid pointer, or a target path that does not exist.
Does JSON Patch support arrays?
Yes. Use an index in the path such as /items/0, and /items/- to append with an add operation.
What operations are supported by RFC 6902?
add, remove, replace, move, copy, and test.
Applying patches runs entirely in your browser. No documents are uploaded.
Schema validation, JSON Patch, JSON diff and JSONPath testing — grouped in one place.