Category: Developer tools

JSON Deep Merge

System ideaMissing a tool?

Merge two JSON objects or arrays with a chosen array strategy

Deep-merge two JSON objects or arrays: nested objects are merged key by key, and arrays are combined by concatenating, replacing or taking the union, whichever you choose. Runs entirely in your browser.

Result
{
  "name": "Ada",
  "tags": [
    "engineer",
    "mathematician"
  ],
  "settings": {
    "theme": "light",
    "notifications": true
  },
  "role": "Lead"
}

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

A shallow merge only combines an object's top-level keys, so nested settings in JSON B silently overwrite the entire nested object from JSON A. This tool merges recursively instead: matching nested objects are merged key by key, and arrays follow whichever strategy you pick, so a config or preferences object with several levels of nesting merges the way you'd expect.

How to use it

  1. Paste the base document into JSON A and the overrides into JSON B.
  2. Choose how arrays should combine: concatenate both, replace A's array with B's, or take the union of both.
  3. Read the merged result, with B's values winning wherever both documents share a key.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

What happens when both documents have the same key?
If both values are objects, they merge recursively; if both are arrays, they combine using the chosen array strategy; otherwise JSON B's value wins.
What does 'Union' do for arrays?
It keeps every item from JSON A, then appends items from JSON B whose serialized value doesn't already appear in the combined array, so no duplicate entries are added.
Can I merge two JSON arrays instead of two objects?
Yes. If both JSON A and JSON B are arrays, they merge directly using the array strategy, without needing to be wrapped in objects.