Apply JSON Patch Operations
Build and apply RFC 6902 JSON Patch operations — add, remove, replace, move, copy, and test — against any JSON document using JSON Pointer paths.
Open JSON Patch & Pointer with a ready-to-run example.
- You are implementing a PATCH endpoint that accepts RFC 6902 operations and need to verify your document changes.
- You want to test a series of patch operations before writing server-side code.
- You need to generate the patch document that describes the difference between two JSON objects.
- You are using JSON Pointer paths in a configuration system or data pipeline and need to verify paths are correct.
- Paste the target JSON document in the left panel.
- Enter one or more RFC 6902 patch operations in the patch panel (an array of operation objects).
- Click Apply to see the patched result — or use the Diff mode to auto-generate a patch from two JSON documents.
- Use the JSON Pointer tab to test a pointer path against a document and see the referenced value.
- Patch operations are applied in order — if an earlier operation fails, subsequent ones do not execute.
- To append to an array, use path
/myArray/-(the-token targets the end of the array). - Escape
/in property names as~1and~as~0in JSON Pointer paths. - The
testoperation asserts a value without changing the document — useful for conditional patches.
Add, replace, and remove fields
{
"name": "Alice",
"role": "viewer",
"temp": "remove-me"
}
[
{ "op": "replace", "path": "/role", "value": "admin" },
{ "op": "add", "path": "/email", "value": "alice@example.com" },
{ "op": "remove", "path": "/temp" }
]
{
"name": "Alice",
"role": "admin",
"email": "alice@example.com"
}
JSON Patch (RFC 6902) describes a sequence of changes to apply to a JSON document. Each change is an object with an op (add, remove, replace, move, copy, test), a path (JSON Pointer), and optionally a value.
JSON Pointer (RFC 6901) is a string like /user/address/city or /items/0 that uniquely identifies a location within a JSON document. It starts with / and each segment separates keys or array indices.
add creates a new field (or appends to an array with /-) and succeeds even if the field did not exist. replace updates an existing field and fails if the path does not exist — use it when you need to guarantee the field was already there.
Privacy-first: runs locally in your browser. No uploads.