Compare two JSONs to generate RFC 6902 patches with 6 operations, apply & verify
Zero Dependencies · Works Offline📥 Source JSON
📤 Target JSON
📋 Patch Operations
📄 JSON Patch Code
What Can the JSON Patch Generator Do?
The JSON Patch Generator is a free online developer tool that automatically generates RFC 6902 standard JSON Patches by comparing two JSON documents. Supports add, remove, replace, move, copy, and test operations. Can apply patches to verify results match the target. Ideal for API partial updates, configuration change tracking, and version diff synchronization. All processing runs locally in your browser—no data is ever uploaded.
Core Features
- Auto Comparison: Recursive JSON diff with optimal patch generation
- 6 Operations: Full support for add/remove/replace/move/copy/test
- Apply & Verify: Apply patch to source and verify result matches target
- Visual List: Color-coded operation tags for easy reading
- JSON Pointer: Auto-generates RFC 6901 standard paths
How to Use
1. Paste source JSON in the "Source JSON" input.
2. Paste modified JSON in the "Target JSON" input.
3. Click "Generate Patch" to see the operation list and patch code.
4. Click "Apply & Verify" to confirm patch correctness.
Use Cases
API Partial Updates
Backend developers use JSON Patch for API PATCH methods, transmitting only changes to reduce network overhead.
Configuration Change Tracking
Ops teams use JSON Patch to record each configuration change for audit and rollback.
Collaborative Editing
Multi-user collaboration uses JSON Patch to sync modifications across clients and resolve conflicts.
Technical Background
JSON Patch (RFC 6902) is a standard format for describing JSON document changes, consisting of an ordered list of operations. Each operation contains op (type), path (JSON Pointer), and value (for some operations). JSON Pointer (RFC 6901) uses /-separated paths with ~ and / escaped as ~0 and ~1. JSON Patch is atomic—all operations succeed or all fail. The test operation enables conditional checks; if the value doesn't match, the entire patch fails. Compared to JSON Merge Patch (RFC 7396), JSON Patch is more powerful for array operations but has more complex syntax.
❓ FAQ
What is JSON Patch?
RFC 6902 format for describing JSON changes using operation lists. Commonly used for API partial updates.
What operations are supported?
6: add, remove, replace, move, copy, test.
What is JSON Pointer?
RFC 6901 path expression using /-separated keys, e.g., /user/name. Arrays use numeric indices.
JSON Patch vs Merge Patch?
Patch uses explicit operations, handles arrays. Merge Patch uses merge semantics—simpler but can't handle partial array changes.
Is data uploaded?
No. All comparison and patch generation runs locally.