JSON deep merge

Client

Combine a base document with an overlay—nested objects merge key by key; lists and scalars from the overlay replace the base value. Use URL params left / right for agent prefill.

Learn more: deep merge

Combine two JSON objects so nested objects merge per key; the right document is the overlay.

Arrays

If either side has an array at the same key, the right-hand array replaces the left entirely—this is not a zip or union merge.

Deep merge

?

The right-hand document overlays the left. Nested objects merge recursively; arrays and primitives from the right replace the left value entirely.

Common use cases

  • Layer environment-specific overrides on a shared defaults object without hand-copying nested keys.
  • Preview how two config drafts combine before merging in code or CI.
  • Compare merge results with JSON Merge Patch or JSON Patch workflows when choosing an update strategy.

Common mistakes to avoid

  • Expecting arrays to concatenate

    This deep merge replaces the entire array when the overlay provides one. Use list-specific logic if you need append/merge-by-id behavior.

  • Confusing deep merge with JSON Merge Patch (RFC 7396)

    Merge Patch has null semantics and different rules. If your API speaks RFC 7396, use the Merge Patch page instead.

FAQ

Is merging performed locally?

Yes. Both documents are merged in your browser; nothing is uploaded.

Which side wins on conflicts?

The right (overlay) document wins for scalars and arrays. Nested objects are merged recursively until a leaf value replaces the base.

Related utilities you can open in another tab—mostly client-side.