Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
● RFC 6902 · RFC 7386 · 100% BROWSER-BASED

JSON Patch Generator & Applier

Generate an RFC 6902 JSON Patch or an RFC 7386 Merge Patch from two documents, or apply an existing patch and see the result before you run it. Nothing is uploaded.

Source document
Target document
JSON Patch (RFC 6902)
Fill both panes to see the result

JSON Patch vs Merge Patch

Both formats describe a change to a JSON document, and they are not interchangeable. JSON Patch is a list of operations addressing locations by JSON Pointer; Merge Patch is a document shaped like the target, where null means “remove this member”.

Merge Patch cannot set a value to null

Because null already means “delete”, there is no way to say “set this field to null”. If your API has nullable fields, Merge Patch is the wrong format. This tool detects the case and tells you, rather than emitting a patch that quietly deletes the field.

Merge Patch replaces whole arrays

It has no way to address an array element, so changing one item means sending the entire array. JSON Patch can target /roles/1 directly.

JSON Patch is atomic, and can assert

RFC 6902 §5 requires that a failed operation leaves the document untouched. The test operation asserts a value before changing it, which gives you optimistic concurrency without an ETag. Turn on Add test ops to generate them.

There is no single correct patch

For arrays in particular, several different patches correctly transform the same source into the same target. This generator compares array elements positionally and then trims or extends the tail. It does not try to detect that an element moved and emit move or copy: those patches are shorter but harder to read, and choosing between them is a heuristic, not a rule. Every patch produced here is verified to reproduce the target exactly — tested on 30,000 randomly generated document pairs and against the community json-patch-tests conformance suite.

Specifications

Measured over 39,000 changes: Merge Patch is smaller 96% of the time and cannot express 10% of changes at all. When JSON Merge Patch cannot do the job →