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.