JSON Patch Generator

Compare two JSON values and generate an RFC 6902 JSON Patch (add / remove / replace) automatically.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

0 chars

or drag & drop a file

What is JSON Patch Generator?

JSON Patch Generator compares two JSON values and produces a RFC 6902 (JSON Patch)-compliant document describing the differences.

Unlike a visual diff viewer, the output is machine-readable and can be passed directly to a JSON Patch library to apply the changes programmatically.

RFC 6902 Operations

Operation Description
add Insert a value at the specified path
remove Delete the value at the specified path
replace Replace the value at the specified path
move Move a value to another path
copy Copy a value to another path

Example Output

[
  { "op": "replace", "path": "/age",   "value": 31 },
  { "op": "remove",  "path": "/role" },
  { "op": "add",     "path": "/email", "value": "alice@example.com" }
]

Applying this patch to the original JSON updates age, deletes role, and adds email.

How to Use

  1. Paste the original JSON into the left input field.
  2. Paste the modified JSON into the right input field.
  3. Click "Generate Patch" to produce an RFC 6902-compliant patch.
  4. Copy the result or download it as a JSON file.
  5. Click "Example" to see a quick demo.

FAQ

What is RFC 6902?

RFC 6902 is the JSON Patch standard. It describes changes to a JSON document as a sequence of operations — add, remove, replace, move, copy, and test. It is widely used in HTTP PATCH requests and configuration management.

How is this different from JSON Diff?

JSON Diff is a visual viewer for differences. JSON Patch Generator goes further by producing machine-readable RFC 6902 output that can be applied programmatically using libraries in any language.

Can I apply the generated patch directly?

Yes. The output is standard RFC 6902 JSON. In JavaScript you can use fast-json-patch or json-patch; in Python use the jsonpatch library.

Are nested objects and arrays supported?

Yes. Nested objects are compared recursively, with each changed field expressed as a JSON Pointer path. Arrays are handled by removing from the end and appending to the end.

Is my data sent to a server?

No. All processing runs in your browser. Nothing is transmitted externally.