Skip to content
Back to Blog
·4 min read

JSON Merge Patch (RFC 7396): Simple Partial Updates Explained

JSON Merge Patch (RFC 7396) provides a simple way to describe partial updates to JSON documents. Unlike the more complex JSON Patch (RFC 6902), merge patch uses a partial document that's applied directly. Our JSON Merge Patch tool makes it easy to apply and test merge patches.

What Is JSON Merge Patch?

A JSON Merge Patch is a JSON document that describes changes to be made to a target document. When a field is included in the patch, its value replaces the existing value. When a field is set to null, it's removed from the target.

JSON Merge Patch vs JSON Patch

AspectJSON Merge Patch (RFC 7396)JSON Patch (RFC 6902)
FormatPartial JSON documentArray of operation objects
ComplexitySimple, intuitiveMore operations (add, remove, replace, etc.)
Null HandlingNull = remove fieldExplicit remove operation
ArraysReplaces entire arrayIndex-based operations
Use CaseSimple object updatesPrecise, complex transformations

How to Apply a Merge Patch

  1. Prepare your target JSON document and your merge patch document.
  2. Use our JSON Merge Patch tool to apply the patch.
  3. Review the merged result with all changes applied.

Comparing Documents

Before and after patching, use our JSON Diff Checker to see exactly what changed. For merging multiple JSON objects without patch semantics, use JSON Merge.

Frequently Asked Questions

When should I use Merge Patch vs JSON Patch?

Use Merge Patch for simple object updates where you want to replace or remove top-level fields. Use JSON Patch for complex operations involving array indices or multiple operation types.

How does null work in Merge Patch?

Setting a field to null in the patch removes that field from the target document. This is the standard way to delete fields in Merge Patch.

Use our free JSON Merge Patch tool for your partial update needs.