Data Formats

JSON Patch Generator & Applier — RFC 6902

Generate RFC 6902 JSON Patch operations from two documents, apply and validate existing patches, create inverse patches, and copy JSON Pointer paths locally.

Free to use No sign-up Runs in your browser

Tool workspace

5 operations+2 add-1 remove2 replace

Operation preview

remove
/legacyField
replace
/active
true
add
/createdAt
"1843-01-01"
replace
/user/name
"Ada Lovelace"
add
/user/roles/1
"editor"

Forward JSON Patch

Inverse JSON Patch

Preview patched document

What Is JSON Patch (RFC 6902)?

JSON Patch is an IETF standard for describing changes to a JSON document as an ordered array of operations. Each operation uses a JSON Pointer path and one of six actions: add, remove, replace, move, copy, or test. This tool compares source and target documents to generate a deterministic patch, applies existing patches in order, and creates an inverse patch that can restore the original document. Processing stays in the browser.

How to Generate or Apply a JSON Patch

  1. 1In Generate Patch mode, paste the original document into Source JSON and the desired version into Target JSON.
  2. 2Review each generated operation and copy its JSON Pointer path, the complete forward patch, or the inverse patch.
  3. 3Open the patched-document preview to confirm the generated operations produce the intended target.
  4. 4In Apply Patch mode, paste a JSON document and an RFC 6902 operation array containing add, remove, replace, move, copy, or test.
  5. 5Correct any reported operation number or invalid path, then copy the validated patched JSON output.

Common JSON Patch Workflows

Build HTTP PATCH request bodies

Compare an existing API resource with an edited version and generate the RFC 6902 operation array expected by a PATCH endpoint.

Review configuration changes

Inspect field-level operations and escaped JSON Pointer paths before applying configuration updates to another environment.

Create reversible migrations

Generate a forward patch for an update and an inverse patch that restores the original JSON document.

Debug failing patch operations

Apply third-party patches locally and identify the exact operation number with a missing path, invalid array index, or failed test.

Frequently asked questions

Which JSON Patch operations are supported?

The applier supports all six RFC 6902 operations: add, remove, replace, move, copy, and test. Generated patches use add, remove, and replace because those operations describe document differences deterministically without depending on heuristic move detection.

What is the difference between JSON Patch and JSON Merge Patch?

JSON Patch is an ordered operation array defined by RFC 6902 and can edit arrays, move values, and test preconditions. JSON Merge Patch uses a partial JSON object and null deletion semantics defined by RFC 7396. They are different media types and are not interchangeable.

How are slashes and tildes represented in paths?

JSON Pointer escapes a tilde as ~0 and a slash inside a property name as ~1. The generator applies these escapes automatically, and the applier rejects malformed pointer escapes.

Does this tool upload my JSON?

No. Parsing, comparison, patch generation, validation, and application run entirely in your browser. Documents and patches are not sent to a server.