>_devtools

JSON Merge

Deep-merge two JSON documents with array strategies, or apply an RFC 7386 JSON Merge Patch.

What this does

Combines two JSON documents into one. Choose how conflicts are resolved:

  • Deep merge: objects are merged key by key, recursively. Where both sides have a scalar, the overlay wins; a null in the overlay sets the value to null. Keys keep the base order, followed by new keys from the overlay.
  • Merge patch (RFC 7386): the standard JSON Merge Patch used by many HTTP APIs. Objects merge recursively, a null in the patch deletes that key, and arrays or scalars replace the target wholesale.

Array strategies (deep merge)

  • Replace: the overlay's array replaces the base's.
  • Concatenate: base items followed by overlay items.
  • Union: concatenate, then drop items that are deeply equal (key order inside objects is ignored).
  • Merge by index: items at the same position are merged, and the longer array's extra items are kept.

Notes

Neither input is modified. Keys like __proto__ are treated as plain data. Each document is validated separately, and an error is shown under the document it belongs to.

Privacy

Everything runs in your browser. Your input is never uploaded, stored, or put in the page URL.