Merge JSON
Combine JSON documents with live conflict previews, deep or shallow merging, and explicit array rules.
How it works & useful details
How it works
Incoming values win conflicts. Deep mode merges matching objects recursively and uses your array policy; shallow mode replaces matching values as a whole. A root array follows the array policy. Concatenation preserves order and duplicates. Null is an ordinary value, not deletion. This is a configurable merge, not RFC7396 Merge Patch.
Limits & privacy
Up to 1,000,000 characters, 50,000 values and 64 levels. Live previews pause above 40,000 characters; run the tool to process the full supported input. Imported files must be UTF-8 and under 1 MB. Your data stays on this device.
Numbers use JavaScript decimal precision. Unsupported large integers are rejected; quote identifiers to keep all digits. Duplicate object names keep their last value. Transforms preserve data, not source whitespace or number spelling.
Paths use JSON Pointer: an empty path selects the root, ~0 escapes a tilde, and ~1 escapes a slash.
About this tool
Merge JSON combines two or more documents into one, with deep or shallow merging and explicit rules for arrays. It is the tool for layering a base configuration with overrides without hand-editing nested objects.
Conflicts are previewed before you commit to the merge, so you can see which value wins and why. Merging is local, and documents are never fetched or stored.
How to use it
- Paste the JSON documents in the order they should be merged.
- Choose deep or shallow merging.
- Select the array strategy, such as replace or append.
- Review the conflict preview and export the merged result.
Worked example
Base: {"name":"app","server":{"port":8080,"host":"localhost"},"plugins":["auth"]}. Incoming: {"server":{"port":9090},"plugins":["cache"],"debug":true}.
- Deep merge, replacing arrays: server becomes {"port":9090,"host":"localhost"}, plugins becomes ["cache"], and debug is added.
- Deep merge, concatenating arrays: the same, but plugins becomes ["auth","cache"].
- Shallow merge: server is replaced as a whole with {"port":9090}, so host disappears.
In every mode the incoming value wins a conflict, and keys that only exist on one side are kept.
Picking the right strategy
Deep merging is how most configuration systems layer settings: defaults, then environment overrides, then local overrides. Shallow merging matches JavaScript's { ...base, ...incoming } and Object.assign. Use it when each top-level section should be replaced entirely.
Arrays are the tricky part, because there is no single right answer. Lists of plugins or allowed origins usually need concatenation. Ordered values like coordinates, or anything where duplicates cause problems, usually need replacement. Concatenation keeps duplicates. Note that null is merged as an ordinary value. Unlike RFC 7396 JSON Merge Patch, it does not delete a key.
Frequently asked questions
How are conflicting scalar values resolved?
Later documents override earlier ones. The conflict preview shows both values so the decision is visible.
How are arrays handled?
You choose whether a later array replaces the earlier value or is appended to it; deep index merging is not performed.
What is the limit?
Up to 1,000,000 characters across the input documents.
What happens when the types conflict?
If the base has an object and the incoming document has a string at the same key, the incoming value replaces the object. The live conflict preview shows each such replacement before you export.
