Data / LOCAL TOOL

JSON Patch & Merge Patch Tester

Apply RFC 6902 JSON Patch or RFC 7396 Merge Patch locally and inspect the resulting document.

Runs locally — input is never uploaded
Document to update
RFC 6902 or RFC 7396
Patched JSONReady when you are

WHAT IT DOES

Apply the patch before an API or migration has to.

Paste a source JSON document and either an RFC 6902 operation array or an RFC 7396 Merge Patch. The operation is applied to a clone of the source and the complete resulting document is shown for review and copying. Invalid pointers, failed test operations, missing paths, malformed operations, and invalid JSON stop the run with a specific error instead of leaving a partially patched result.

Why use it?

A small patch can change a large document. Previewing its exact result helps catch the wrong path, an unexpected array update, or a failed precondition before using it elsewhere.

How to use this tool

  1. Paste the original JSON and the patch into their respective panes.
  2. Choose JSON Patch or Merge Patch to match the notation you supplied, then apply the patch.
  3. Review the resulting document before copying it. If an operation fails, fix the patch or source instead of treating the error as a completed update.

Details and limitations

  • JSON Patch supports add, remove, replace, move, copy, and test operations with RFC 6901 pointer escaping.
  • Merge Patch recursively updates object members, removes keys whose patch value is null, and replaces arrays or scalar values as complete values.
  • The source document is cloned before every run, so applying the same patch repeatedly always starts from the text in the source pane.
  • Prototype-modifying pointer segments are refused by the patch engine rather than written into browser objects.

WORKED EXAMPLES

Append an item while guarding the old value

Keep JSON Patch selected. The test operation checks the expected count before replace and add run; /items/- appends to the array rather than overwriting its last entry.

Source JSON

{"count":1,"items":["a"]}

Patch

[{"op":"test","path":"/count","value":1},{"op":"replace","path":"/count","value":2},{"op":"add","path":"/items/-","value":"b"}]

Expected result

Patched JSON: {"count":2,"items":["a","b"]}. If the source count is not 1, the test operation fails; do not treat that as a successful update.

COMMON QUESTIONS

JSON Patch Tester questions

What is the difference between JSON Patch and Merge Patch?
JSON Patch is an ordered array of explicit operations such as add, remove, replace, and test. Merge Patch is a JSON value shaped like the desired update: object members are merged, null removes a member, and arrays are replaced as a whole.
Does a failed JSON Patch leave some operations applied?
No result is shown after a failure. The tool applies every run to a fresh clone and reports the failing operation, so a partial document is never presented as the completed output.
Can I drop files into both panes?
Yes. Drop one .json file into the Source JSON pane and one into the Patch pane. Each file is read locally and limited to 10 MiB.