Converters

JSON Patch (RFC 6902)

Apply a JSON Patch to a document, generate a patch that transforms one JSON into another, or validate that a patch is well-formed. Supports all six RFC 6902 operations: add, remove, replace, move, copy, and test. The test operation is particularly useful — it checks that a value matches before applying the rest of the patch, enabling conditional updates.

JSON Patch (RFC 6902) — Apply, generate, or validate JSON Patch operations per RFC 6902

What it does

  • Applies a JSON Patch (array of operations) to a JSON document
  • Generates a patch that transforms one JSON document into another
  • Validates patch structure — checks op types, paths, and required fields
  • Supports all RFC 6902 operations: add, remove, replace, move, copy, test
  • Uses JSON Pointer syntax (/path/to/field) for addressing
  • Reports errors with the operation index that caused the failure

Use cases

  • Applying a partial update to a JSON document without sending the full document
  • Generating a diff between two JSON states for audit logging
  • Validating that a patch from a client is well-formed before applying it
  • Testing conditional updates using the test operation

How it works

1

Paste your JSON document and patch (or two documents for generation mode)

2

Choose Apply, Generate, or Validate mode

3

The tool processes the operations and outputs the result

4

Errors show which operation failed and why

Frequently asked questions

1What is the test operation for?

The test operation checks that a value at a given path matches an expected value. If it doesn't match, the entire patch fails and no operations are applied. This enables optimistic concurrency — you can ensure a value hasn't changed before modifying it.

2How does the generate mode work?

You provide two JSON documents (original and target). The tool computes the minimal set of operations needed to transform the original into the target, outputting them as a valid JSON Patch array.

3What's JSON Pointer syntax?

JSON Pointer uses slash-separated paths like /users/0/name to address specific locations in a JSON document. It's defined in RFC 6901 and is the addressing standard for JSON Patch operations.

Related tools

Use JSON Patch (RFC 6902) offline in Devinity

All 95 tools run locally on your Mac. No internet required, no data sent to servers.

Download Devinity →