JSON Merge

Deep-merge two JSON objects and concatenate overlapping arrays. Fast, free, and fully client-side.

Loading tool...

How the JSON Merge Works

Deep-merges two JSON documents into one. Objects are combined key by key and recursively, arrays from both sides are concatenated, and for a scalar value the second input wins. The merged result is pretty-printed with two-space indentation. Merging runs in your browser and neither document is uploaded.

Usage Example

Layering environment-specific overrides over a base settings file to produce one effective configuration.

Frequently Asked Questions

What happens to arrays that exist in both inputs?

Arrays are concatenated rather than replaced, so items from the first input come first, followed by items from the second. Duplicate items are not removed, so the same entry can appear twice in the merged result.

Which value wins when both inputs set the same key?

For a scalar such as a string, number, or boolean, the value from the second input replaces the first. When both values are objects, the merge recurses into them instead of replacing either one.

What does an invalid input produce?

If either input cannot be merged, the result area is replaced by a Merge Error box showing the message. Correct the flagged input and the merge runs again automatically, since both documents must parse first.

Browse more

See all JSON tools.