Combine multiple JSON objects or arrays into one with the JSON Merge Tool. Choose
between shallow merging, deep merging, and how to handle array collisions.
Try:
JSON Merge Tool
Deep-merge two JSON objects with conflict controlDev Tools
Merge Settings
Conflict resolution
Array strategy
Null handling
Missing keys
Exclude paths
Source A
Source B
Merged Result
Paste JSON into A and B, then click Merge.
Only in A
Only in B
Conflict (B
won)
Unchanged / merged
Unchanged
0
Only in A
0
Only in B
0
Conflicts
0
Total keys
0
Advertisement
Why deep merge?
Shallow merge ({...a,...b}) silently destroys nested objects.
Deep merge walks into every nested object recursively, so settings.theme
from A and settings.lang from B both survive.
Conflict Resolution
When A and B both have a key with different values:
B wins — B's value overwrites A (default) A wins — A's value is kept Keep both — value becomes [a_val, b_val]
Array Strategy
Replace — B's array fully replaces A's Append — B's items added after A's Prepend — B's items added before A's Union — combine, removing primitive duplicates
Null Handling
Overwrite — if B has null for a key, result is null Skip nulls — if B has null, keep A's existing value instead
Exclude Paths
Type a dot-separated path like meta.timestamp or id
and press Enter. That key will be taken from A unchanged and never overwritten by B.
Result Colours
Green — key only in A Cyan — key only in B Amber — key in both, conflict resolved
White — key identical in both or deep-merged
Advertisement
How to use
Open the tool and enter your data or select options.
Adjust settings to see real-time updates.
Copy the generated result to your clipboard.
Frequently Asked Questions
What is deep merging?
Deep
merging traverses through nested objects and merges their individual properties, rather than simply overwriting
the entire object.
What happens if there are conflicting keys?
By
default, the value from the right-hand (or last) JSON object will overwrite the value from the left-hand object.
Can I concatenate arrays?
Yes,
you can select an option to concatenate arrays together rather than having one array overwrite the other.
Did you know?
The concept of deep merging is incredibly complex in dynamic languages due to references and circular
dependencies.
In JavaScript, the Object.assign() method only performs a shallow merge.
Configuration files often rely on deep merging to combine base defaults with environment-specific overrides.