Merge Multiple JSONs
Combine any number of JSON documents into one with shallow, deep, or array-concatenating merge strategies.
Documents
2 total · 0 filledMerged output
Paste two or more JSON documents and hit Merge.
About merging JSON documents
Merging JSON sounds trivial until two documents disagree. This tool combines any number of JSON documents in order, left to right, and lets you pick exactly how collisions resolve. Everything runs in your browser — nothing is uploaded.
Merge strategies
- Shallow – only top-level keys are considered, exactly like
Object.assignor object spread. A later document’sconfigobject replaces the earlier one wholesale, losing every nested key the earlier copy had. - Deep – plain objects are merged recursively at every level, so nested keys survive unless the later document defines that exact path. Anything that is not a plain object — a string, number, boolean, array, or
null— overwrites whatever sat there before. - Concat arrays – a deep merge that appends arrays at the same path instead of replacing them.
Why arrays are ambiguous. There is no correct default. Replacing the array treats it as an atomic value; concatenating treats it as a bag of items and happily produces duplicates; merging by index assumes the two arrays describe the same positional slots, which is almost never true for lists of records. Libraries disagree here, which is why the choice is a visible toggle rather than a hidden assumption.
null is a value, not an absence. JSON has no undefined, so a key set to null overwrites the earlier value rather than leaving it alone. If you need “delete this key” semantics, you want JSON Merge Patch (RFC 7386), where null means removal, or JSON Patch (RFC 6902) for explicit, ordered operations.
Duplicate keys inside one document are resolved before this tool ever sees them: JSON.parse keeps the last occurrence and silently drops the rest, so a document with two id keys parses without complaint.
Prototype pollution. Deep-merging untrusted JSON is a real attack path: a payload carrying __proto__, constructor, or prototype can write onto Object.prototype and change behaviour for every object in the process. This merger skips those keys outright and builds results with null-prototype-safe assignment.
Tip: the conflict list below the output shows every path where a later document overwrote an earlier value — the fastest way to spot an accidental override in a stack of config layers.