JSON Patch Builder (RFC 6902)
RFC 6902 JSON Patch is a wire format for describing changes to a JSON document — useful for PATCH requests, optimistic updates, undo history, and operational transforms. This tool does both directions: paste a source and target JSON, get the minimal patch that converts one to the other; or paste a source and a patch, see the result after applying. The diff uses recursive structural comparison with `~0`/`~1` JSON Pointer escaping for keys with slashes or tildes. The apply side honors all six ops including `test` (assertion fails throw an error), `copy`, and `move`. Useful for testing patches before hitting your server, or working out the right ops by example.
[
{
"op": "replace",
"path": "/age",
"value": 31
},
{
"op": "replace",
"path": "/address/city",
"value": "Busan"
},
{
"op": "remove",
"path": "/address/zip"
},
{
"op": "add",
"path": "/address/country",
"value": "KR"
},
{
"op": "replace",
"path": "/tags/1",
"value": "owner"
},
{
"op": "add",
"path": "/tags/2",
"value": "user"
}
]Pure RFC 6902 — supports add, remove, replace, move, copy, test ops with `~0`/`~1` pointer escaping.
How to use
- Diff mode: paste source and target, see the patch JSON. Edit either side to see how the patch changes.
- Apply mode: paste source and a patch array, see the resulting document. Errors (bad pointer, failed `test`) show inline.
- JSON Pointer syntax: `/foo/0/bar` walks `foo.0.bar`. Escape `/` as `~1`, `~` as `~0`. Trailing `-` in an array path means 'append'.
Frequently asked questions
- Why not just send the new document?
- Bandwidth for one. Concurrency for two: if Alice and Bob both edit a doc, you can merge their patches semantically (`replace /name` is compatible with `add /tags/-`), while two full docs would have to pick a winner. Plus, patches are a precise audit trail of what changed and when.
- Is this the same as JSON Merge Patch (RFC 7396)?
- No. Merge Patch is simpler — you send a partial document where present keys overwrite and `null` deletes. It's easier for humans but loses precision (can't add to an array, can't represent literal `null` values, no atomic test). RFC 6902 (this tool) is the precise wire format. RFC 7396 is the convenience format.
Related tools
JSON Pointer Resolver (RFC 6901)
Resolve an RFC 6901 JSON Pointer like /user/roles/0 against a JSON document, with ~0/~1 escaping and URI-fragment (#/…) support — plus a clickable list of every pointer in the document, in your browser.
JSON Diff
Compare two JSON documents structurally — see exactly which keys were added, removed, or changed.
Semver Tools (Parser, Comparator, Bumper)
Parse, compare, and bump semantic versions side-by-side, with a range expander that shows what ^x.y.z and ~x.y.z actually cover.
PWA Manifest Builder
Build a valid `manifest.json` for a Progressive Web App — name, icons, theme color, display mode, scope, orientation — with the matching HTML `<link>` and Apple meta tags.
Quoted-Printable Encoder & Decoder
Encode text to MIME Quoted-Printable (RFC 2045) or decode it back — handling =XX escapes, soft line breaks, and UTF-8 — entirely in your browser, with 76-character line wrapping on encode.
JWK to PEM Converter (and back)
Turn a JWK or a whole JWKS into PEM public keys and back, with the RFC 7638 thumbprint for each — computed in your browser.