Using JSON Patch Builder & Tester

Generate a JSON Patch from two documents or apply add, remove, replace, move, copy and test operations to a copy.

  1. A patch is an array of operations applied in order to a copy of the document. If any operation fails, nothing is changed (atomic).
  2. Paths are JSON Pointers : /tags/0 is the first tag, /tags/- appends, ~1 stands for / and ~0 for ~ inside a key.
  3. add inserts or sets, remove deletes, replace needs the path to exist, move and copy take a from pointer, test checks a value and stops the patch if it differs (type matters: "10" is not 10 ).
  4. Generate compares two documents and writes a patch; arrays are aligned element by element (very large ones, over 250,000 comparisons, are replaced whole), and the patch is checked by applying it. Removing the entire root document is unsupported.
  5. Your data is kept exactly. Big integers, long decimals, 1.0 and 1e400 are never rounded, and keys stay in order. A test still treats 1 and 1.0 as equal. JSON Patch has no key positions, so a key that is added back goes last.

Example

{"name":"Ada","roles":["reader"]}

Questions & answers

What does this tool do?

Generate a JSON Patch from two documents or apply add, remove, replace, move, copy and test operations to a copy.

What should I check before using the result?

Arrays in generated patches are replaced as a whole. Failed operations produce no partial output; removing the entire root document is unsupported.

Is there an upload or installation?

Processing runs in a local browser worker with no processing upload. No account or installation is required. Website ads and analytics follow the site privacy policy.

What input sizes are supported?

Each input supports 250,000 UTF-16 units and UTF-8 files up to 500 KB. Jobs stop after 15 seconds. Report previews show 200 rows; downloaded reports include all computed rows.

Will my work be saved?

No automatic storage is used. Download the result and report before leaving. Changing input invalidates previous output.

What can I download or copy?

From the page: Patch .json, Result .json, Patch YAML, Markdown report, PNG snapshot, PDF step book, Animated GIF, WebM video, MP4 video, ZIP of everything, Run JSON tool →, Download report JSON, json compare, JSON Merge Patch. Everything is created in your browser.

Help improve this tool

Report a problem or suggest an improvement

Describe the issue without pasting private tool input. Feedback goes to our admin inbox.

Find another tool · Read practical guides