Generate an RFC 6902 JSON Patch — the add/remove/replace operations that transform document A into document B — ready for HTTP PATCH requests and audit logs.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Changes as data
An RFC 6902 JSON Patch expresses edits as an ordered list of operations — machine-applyable, loggable, reviewable. Paste the original and the modified document; the generator emits the add, remove and replace operations (with RFC 6901 JSON Pointer paths) that transform one into the other. Send it as application/json-patch+json in an HTTP PATCH, store it as an audit record, or replay it elsewhere.
Worked example
[
{ "op": "replace", "path": "/status", "value": "published" },
{ "op": "add", "path": "/tags/-", "value": "featured" },
{ "op": "add", "path": "/author", "value": "Asha" },
{ "op": "remove", "path": "/title" }
]When to use it
- Building PATCH requests that send only the changes, not the whole document.
- Producing audit trails: what exactly changed between two versions of a record.
- Creating replayable migrations for JSON documents.
Limitations to know
- Array edits are index-based per the RFC — a mid-array insertion generates several replaces plus an add. Verbose, but exactly correct when applied in order.
- move/copy are never inferred; the generator emits only what it can prove (add/remove/replace).
- JSON Pointer escaping:
/in a key becomes~1and~becomes~0— handled automatically.
Verify before you ship
- Paste the original document and the generated patch into the JSON Patch Applier — the output must equal your modified version. That round trip is the whole quality check, and it takes ten seconds.
How to use the JSON Patch Generator
- Paste the original document into A and the modified version into B.
- Click "Generate patch".
- The output is an RFC 6902 operations array — add, remove and replace with JSON Pointer paths.
- Use it in an HTTP PATCH request, an audit log, or test it in the JSON Patch Applier.
Frequently asked questions
What is a JSON Patch?
A standard format (RFC 6902, media type application/json-patch+json) describing edits to a JSON document as an ordered list of operations. Instead of re-sending a whole document, you send just the changes — precise, replayable and loggable.
Which operations does the generator emit?
add, remove and replace — enough to express any transformation. It does not infer move or copy (deciding that a removal plus an addition was really a "move" is guesswork the RFC does not require).
What do the /paths/like/this mean?
JSON Pointer (RFC 6901): each segment steps into an object key or array index, with "-" meaning append. Special characters escape as ~0 (~) and ~1 (/).
Why so many operations for one small array change?
RFC 6902 speaks in indexes, so inserting an element mid-array shifts everything after it — expressed as several replaces plus an add. The patch is verbose but exactly correct when applied in order.