JSON Merge Tool

Deep-merge two or more JSON objects with configurable strategies: concat arrays vs replace, last-wins vs first-wins on scalar conflicts. Useful for combining config files, layering overrides, or computing the union of API responses.

How to use the JSON Merge Tool

Paste two JSON objects. Deep-merge walks both trees: nested objects merge recursively, scalars resolve per the conflict strategy, arrays follow the array strategy. The result is the union with overrides applied.

Deep-merging JSON objects

Layering configuration is a recurring need: a base config plus an environment override, defaults plus user settings, two API responses you want combined. A shallow merge gets this wrong — it replaces whole nested objects instead of merging their fields — and the tricky parts are always how to treat arrays and what to do when two scalars collide.

This deep-merges two JSON objects, recursing into nested objects and letting you choose the rules: replace, concatenate, or de-duplicate arrays, and last-wins or first-wins on scalar conflicts. It combines whole documents at once; when you instead want to describe a precise sequence of edits — add, remove, or replace a single value — the JSON patch tool expresses changes as discrete RFC 6902 operations.

Common use cases

  • Layer config — overlay an environment override on a base configuration.
  • Apply defaults — merge user settings on top of defaults.
  • Combine responses — union two API payloads into one object.
  • Control arrays — choose whether arrays replace, concatenate, or de-duplicate.
  • Resolve conflicts — decide whether the base or the override wins on clashing scalars.

Frequently asked questions

Is the merge deep or shallow?

Deep — nested objects merge recursively rather than one object replacing another wholesale.

How are arrays handled?

You choose: replace them, concatenate them, or concatenate and de-duplicate.

What happens when two scalar values conflict?

A strategy decides the winner — last-wins (the override) or first-wins (the base).

When should I use JSON patch instead?

When you need to describe specific edits as operations; the JSON patch tool applies RFC 6902 add, remove, and replace ops.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: