JSON Patch
Apply JSON Patch locally with exact numbers, atomic errors and downloadable results.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
Applies and tests RFC 6902 operations locally, preserves exact number tokens and reports the failing operation without offering partial output.
How to use it
- 1Paste or load the original JSON and patch array.
- 2Apply the patch, or cancel the local worker.
- 3Review the complete result and download JSON or a value-free operation report.
Example
- Input
- Document: {"x":1} Patch: [{"op":"replace","path":"/x","value":2}]
- Output
- {"x":2}
What happens to your data
Documents stay in the local worker. No API is contacted. Result downloads contain your data; diagnostic reports omit values and pointer paths.
Last updated October 2026
Apply a JSON Patch to a document before sending a partial update to an API, editing a configuration or reviewing a migration fixture. Paste the original JSON and an array of operations, then inspect the resulting document. All six RFC 6902 operations are available: add, remove, replace, move, copy and test. Processing happens in a disposable browser worker, without sending your document to an API.
This tool applies an existing patch; it does not infer a patch from two versions. Use JSON Diff to compare versions, JSON Pointer to locate one value, and JSON Schema Validator to check application-specific rules afterwards. A successfully applied patch establishes only that these operations work against this document. It cannot establish authorization, server-side constraints or whether an API accepts the same update.
How it works
A patch is an array, and its operations run in order. Each operation sees the result of the preceding operation. A failed test, missing member, invalid index or unsupported operation stops the patch. No partial patched file is offered after failure, and editing either input removes the previous result. The error identifies the one-based operation number; syntax and document errors are identified separately.
The path and from fields use JSON Pointer strings. An empty string selects the whole document, / selects a property whose name is empty, ~1 means a slash inside a name and ~0 means a tilde. URI fragments beginning with # and JSONPath expressions are not accepted. An array index must be a nonnegative integer without leading zeros. The - append marker is accepted only as an add destination, including the add part of move or copy.
Add replaces an existing object member or inserts into an array. Replace and remove require an existing target. Copy clones a value rather than linking two mutable objects. Move removes the source before resolving the destination, which matters when moving within one array. Moving a value into one of its descendants is rejected; moving to the same path leaves the value intact. Test uses JSON logical equality: object member order does not matter, array order does, and numeric spellings such as 1, 1.0 and 1e0 compare equally.
The parser keeps numeric tokens instead of round-tripping them through JavaScript Number. An ID such as 9007199254740993 therefore remains exact, and unchanged numeric spellings survive the output. Arithmetic is not performed. Number tokens longer than 4,096 characters are rejected. Strings and object names may be re-escaped and whitespace is compacted; this is value preservation rather than byte-for-byte source preservation. Duplicate object names are rejected as ambiguous, including names with different escape spellings that decode identically. Special names such as __proto__ are safely represented as Map entries and treated only as document data.
Removing the document root is deliberately rejected because it leaves no JSON document to download. Use root replace or add with null only when null is the result you actually intend. Unrecognized operation members are ignored as required by RFC 6902; an unknown operation name is an error. The tool does not fetch references, execute values, save documents in browser storage or contact an API.
Each input is limited to 256 KiB, with depth 64 and 20,000 parser tokens. A patch has at most 100 operations; pointers have at most 4,096 characters. After every operation, the result is bounded to 20,000 values, depth 64 and 512 KiB. A worker is stopped after 10 seconds, including startup; Cancel or changing an input terminates it. A timeout supplies no conclusion about whether the patch would succeed.
The patched JSON contains the complete supplied data. The separate report includes operation types, counts and output size, but omits values, paths and source filenames. Review both files before sharing. Local processing does not mean every network request made by the surrounding website is absent; it means the input documents are not uploaded by this tool.
Worked example: Guard a status change without rounding an ID
- Input
- Document: {"id":9007199254740993,"status":"draft"} Patch: [{"op":"test","path":"/status","value":"draft"},{"op":"replace","path":"/status","value":"ready"}]
- Result
- {"id":9007199254740993,"status":"ready"}
The first operation checks the expected old status. If it differs, no patched download is produced.
Common use cases
- Trying a guarded API update against a local fixture before sending it
- Replaying a recorded JSON Patch while checking the failing operation
- Changing nested configuration values without rounding numeric identifiers
- Testing array move and escaped-pointer behavior with a small reproducible example
Frequently asked questions
Does this tool send a PATCH request to my API?+
No. It applies the operation array only to the JSON supplied in your browser. There is no endpoint field or remote request.
Why does moving array index 1 to index 3 differ from swapping them?+
Move removes the source first and then adds it at the destination in the remaining array. It is not a swap; array lengths and index positions change during the operation.
Can the result lose large integer digits?+
Numeric tokens are preserved and numeric tests use exact decimal normalization, so an unsafe JavaScript integer is not silently rounded. The tool does not calculate arithmetic or convert number tokens to floating point.
What happens if a later test fails?+
The operation number is reported and no partial result is available. Your original input stays unchanged.
Why is root removal rejected?+
Removing the root leaves no JSON document to export. This explicit limitation avoids silently treating a missing document as JSON null.
Is JSON Patch the same as JSON Merge Patch?+
No. JSON Patch is an array of named operations with pointers. JSON Merge Patch uses a different object-shaped format and deletion rules; it is not accepted here.
Related tools
JSON Diff
Compare JSON by ID, ignore noisy paths and export a strict JSON Patch when the comparison permits.
JSON Pointer Extractor
Extract JSON values with RFC 6901 pointers, preserve exact digits and download locally.
JSON Schema Validator
Validate JSON with Draft 7 or 2020-12 schemas. Find failing paths and download a private report.
JSON Formatter & Validator
Format, validate, and minify JSON with exact line errors, a searchable tree, and private processing.