DataToolsLab
JSON Tools

JSON Patch Generator

Generate RFC 6902 JSON Patch from before/after documents.

Loading tool…

What is JSON Patch?

The JSON Patch Generator takes a before/after document pair and produces an RFC 6902 JSON Patch array describing exactly what changed. Useful for PATCH API requests and config drift automation.

How it works

We walk both parsed documents with our structural diff engine, then translate each difference (added/removed/changed) into the corresponding JSON Patch operation. The result is a valid RFC 6902 patch array ready to use in HTTP PATCH requests.

  1. Paste the original and modified documents. Drop or paste the 'before' document on the left and the 'after' on the right. Both panels support file drop.
  2. Review the detected changes. An expandable summary shows each change with its JSON Pointer path and kind (added/removed/changed).
  3. Copy or download the patch. Copy the generated JSON Patch to clipboard or download as patch.json.

Examples

Age changed

Original: {"name":"Alice","age":30}, Modified: {"name":"Alice","age":31} generates [{"op":"replace","path":"/age","value":31}].

Field added

Adding an email field generates [{"op":"add","path":"/email","value":"a@b.com"}].

Common mistakes

Backslash in paths

JSON Pointer uses ~0 for ~ and ~1 for /. The generator handles escaping automatically.

Non-JSON input

Both inputs must be valid JSON. If either side has a parse error, the tool reports it before attempting a diff.

Alternatives

JSON Diff

Visual diff view without the RFC 6902 patch format.

JSON Merge

Two-way or multi-way merge instead of patch generation.

Frequently asked questions

Is this the same as JSON Diff?

JSON Diff shows you the visual diff; the Patch Generator converts those differences into a machine-readable RFC 6902 JSON Patch document.

Does it support move/copy operations?

Wave 4 generates add/remove/replace. Move/copy support can be added by detecting value identity across paths.

Online