JSON Patch Generator

Generate RFC 6902 JSON Patch or RFC 7396 merge patch between two JSON documents.

  • 100% client-side · your data never leaves your browser
  • Instant, no rate limits
  • Free, no sign-up
JSON A (before)
JSON B (after)
JSON Patch operations

Paste two JSON documents to generate a patch.

Overview

JSON Patch Generator — RFC 6902 & Merge Patch

Generate JSON Patch (RFC 6902) or JSON Merge Patch (RFC 7396) from two JSON documents. See the exact add, remove, and replace operations — or merge overlay — needed to transform document A into document B. Ideal for API versioning, config migrations, and debugging diffs without uploading data.

No uploadsNo sign-upOpen source
  1. JSON Patch vs Merge Patch

    JSON Patch is an array of operations (add, remove, replace) with JSON Pointer paths — precise and suitable for PATCH HTTP endpoints. Merge Patch is a partial document that merges into the target; null values remove keys. Choose based on your API or library support.

  2. Anatomy of a JSON Patch

    An RFC 6902 patch is a JSON array of operation objects, each with an op (add, remove, replace, move, copy, or test) and a path written as a JSON Pointer like /user/roles/0. replace updates an existing value, add inserts a new one, and remove deletes it. Because the operations are explicit and ordered, a patch is an auditable, machine-applicable record of exactly how one document became another.

  3. Patching APIs and PATCH requests

    HTTP PATCH endpoints often accept RFC 6902 or RFC 7396 bodies so clients can send only what changed instead of the whole resource. Generating the patch from a before/after pair lets you build those requests precisely, version config changes, or store compact deltas rather than full document snapshots.

  4. Relationship to compare

    The Compare tool visualizes differences for human review; this tool exports the machine-readable patch you apply in code or send to an API. Use them together: compare to understand a change, then generate the patch to ship it.

FAQ

Frequently asked questions

How do I generate a JSON Patch between two objects?

Paste the original and updated JSON; JsonDrift outputs the RFC 6902 operations (or an RFC 7396 merge patch) that transform one into the other.

What's the difference between JSON Patch and Merge Patch?

JSON Patch (RFC 6902) is an ordered list of add/remove/replace operations with pointer paths. Merge Patch (RFC 7396) is a partial document merged into the target, where null removes a key.

Does this apply patches?

It generates patches only. Apply them with your runtime's JSON Patch library.

Which format should I use?

Use RFC 6902 for precise, operation-based changes and APIs that expect it; use RFC 7396 for simple merge overlays.

Continue with a related tool

All tools

Learn more in our guides

All guides