JSON Patch Generator & Applier
Generate a standard RFC 6902 JSON Patch between two documents, or apply a patch to a document. Supports add, remove, replace, move, copy, and test operations — the same format used by REST PATCH requests and Kubernetes.
Features
🩹 Standards-Compliant
- Generates minimal add/remove/replace patches
- Applies add, remove, replace, move, copy, test
- Correct RFC 6901 JSON Pointer escaping (
~0/~1) - Array append via the
"-"path segment
⚡ Privacy-First
- All computation happens in your browser
- No data ever sent to a server
testoperation failures are reported clearly- Download or copy the result instantly
🔗 Real-World Use
- Debug PATCH request bodies for REST APIs
- Inspect Kubernetes strategic merge patches
- Pairs with our JSON Diff tool for visual comparison
- Verify a patch round-trips to the expected document
JSON Patch Guide
JSON Patch (RFC 6902) is a standard format for describing changes to a JSON document as a sequence of operations — add, remove, replace, move, copy, and test — each targeting a location via a JSON Pointer (RFC 6901) path like /user/tags/0. It's the format used by HTTP PATCH requests in many REST APIs and by Kubernetes for partial resource updates.
Frequently Asked Questions
How is this different from JSON Diff?
JSON Diff is for humans — a visual, side-by-side comparison. JSON Patch produces a machine-readable list of operations conforming to RFC 6902 that another system can apply directly, e.g. as the body of an HTTP PATCH request.
What does the test operation do?
A test operation checks that a value at a given path matches an expected value before continuing. If the check fails, applying the patch stops with an error — useful for optimistic concurrency control.
How do I append to an array?
Use "-" as the final path segment, e.g. {"op": "add", "path": "/items/-", "value": "new"} — this appends to the end of the array per the RFC 6901 spec.