Skip to content

JSON Patch Generator

Create a JSON Patch (RFC 6902) that turns one JSON document into another. Paste the original and the changed document, and the tool lists the add, remove and replace operations with JSON Pointer paths. Optionally add test operations so the patch only applies to the exact original.

Reset

Frequently asked questions

What is a JSON Patch?

JSON Patch, defined in RFC 6902, is a JSON array of operations such as add, remove, replace, move, copy and test. Each operation has a path written as a JSON Pointer, such as /users/0/name. HTTP APIs accept it with the media type application/json-patch+json.

Which operations does the generator produce?

It produces add, remove and replace operations, plus test operations when you turn them on. Applying the patch to the original document gives exactly the changed document.

What do the test operations do?

A test operation checks that a value is what the patch expects before it is changed. If someone has changed the document in the meantime, applying the patch fails instead of silently overwriting their change.

How are arrays compared?

Array items are compared by position. Removing an item from the middle of an array therefore shows up as replace operations for the following positions and a remove at the end, rather than a single remove.

How are special characters in keys written?

Following RFC 6901, a slash in a key is written as ~1 and a tilde as ~0. The key a/b therefore appears in a path as /a~1b.

What if the two documents are equal?

The result is an empty array, which is a valid patch that changes nothing.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.