JSON Patch Tester

Apply RFC 6902 add, remove, replace, move, copy and test operations locally, with exact JSON numbers and operation errors.

How to use

A patch is an ordered array of add, remove, replace, move, copy or test operations. Paths use JSON Pointer: /items/0 selects the first array item, ~1 represents a slash in a key, and ~0 represents a tilde.

add inserts an array item; /- appends. replace and remove require an existing value. A move removes its source before resolving the destination index and cannot move an ancestor into its own child. A failed operation returns no partial result.

Behavior and limits

Number tokens are preserved. test compares numeric values exactly, so 1 and 1.0 are equal without rounding large integers. Duplicate keys are rejected. Limit: 200 operations, 64 levels and 200,000 input/result characters. Removing the document root produces no JSON document.

Questions & answers

Is this JSON Merge Patch?

No. RFC 6902 uses explicit operations. RFC 7396 Merge Patch uses a partial document and treats null members as deletions.

Is my input sent to a server?

No. Processing runs in your browser and input is not submitted to an API. Original files and remote databases are not modified.

Other Languages

JSON Patch Tester — Base64.sh

JSON Patch Tester

Apply RFC 6902 add, remove, replace, move, copy and test operations locally, with exact JSON numbers and operation errors.

Share:

References

How we make sure

We check this tool with the automated test suites linked below. Example checks are shown in their original language.

Verification method
Check all six Patch operations and atomic failure positions, including numeric/object-order/negative-zero comparison.
Comparison reference
Explicit fixtures for RFC 6902 operation semantics.
Verification scope
These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
  • data-tools.test.js
    • JSON Patch implements all RFC 6902 operations and atomic failure positions
    • JSON Patch exact tests compare exponent values, object order and signed zero

These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.