Developer Tools
JSON Merger
Merge two JSON objects in your browser. Deep or shallow, choose how arrays combine, control conflicts, sort keys, copy the result.
Merge
Two JSON values into one
Merged result
6 merged, 4 left-only, 3 right-only, 2 overrides, 1 array merges
{
"name": "Ada Lovelace",
"role": "lead engineer",
"address": {
"city": "London",
"country": "UK",
"postcode": "SW1"
},
"skills": [
"compilers"
],
"settings": {
"theme": "dark",
"notifications": true,
"language": "en"
},
"score": 100,
"active": true
}How to use
- Paste the base JSON on the left and the overlay JSON on the right. Click Load sample for a worked example you can edit.
- Turn Deep merge on to combine nested objects field by field, or off for a top-level shallow merge that mirrors the spread syntax.
- Pick the conflict policy: Right wins for standard overrides, Left wins for defaults, or Show conflicts to surface every disagreement.
- Pick the array strategy: Replace, Concat, Union with dedupe, Merge by index, or Keep left, depending on how the two arrays should combine.
- Choose the null policy: null overwrites lets you erase a value with an explicit null, null ignored protects defaults from accidental nulls.
- Toggle Sort keys alphabetically for a canonical key order, switch between Pretty and Minified output, then Copy result or click Use as new left to chain another merge on top.
About this tool
JSON Merger combines two JSON values (the Left base and the Right overlay) into a single merged result with explicit, predictable rules. Deep merge recurses into nested objects so config trees, internationalization bundles, environment overlays, and API payloads combine field by field; shallow merge replaces the entire child object whenever the key exists on both sides and mirrors the behaviour of the JavaScript spread syntax. The conflict policy controls what happens when both sides hold a scalar at the same path: Right wins is the default and matches Lodash _.merge, Ramda mergeDeepRight, and most config override workflows; Left wins keeps the base value and treats the overlay as a fallback, which is the right choice when you merge defaults on top of a partial user object; Show conflicts merges with right-wins and lists every disagreeing path so you can resolve them by hand. Array strategy decides how two arrays combine at the same key: Replace and Keep left treat arrays as opaque values, Concat appends one to the other, Union concatenates and drops duplicates using a canonical JSON representation so {a:1,b:2} and {b:2,a:1} are recognised as the same item, and Merge by index walks the two arrays position by position and merges each pair using the same rules. The null policy controls whether a null on the right erases the left value (the typical config-override behaviour) or is treated as a missing slot so a sparse overlay never clobbers a real default. Sort keys alphabetically produces a canonical key order across the whole tree, which is ideal when the merged JSON is going into a snapshot test, a Git commit, or a diff against a base file. The output supports pretty printing with 2 or 4 space indents, tab indents, or fully minified form, and a Use as new left button lets you chain a third, fourth, or fifth JSON file on top of the running result so multi-file merges stay deterministic. Parsing and merging both run in your browser via the native JSON parser, so configs, secrets, and any data you paste here stay on your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
JSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
DeveloperJSON Diff Checker
Structural compare with paths for added, removed, and changed values.
Open tool
DeveloperJSON Flatten Unflatten
Two-way converter between nested JSON and path-keyed flat JSON.
Open tool
DeveloperJSON Sort Keys
Sort keys in any JSON object. Deep or top-level, A to Z or Z to A, with natural order support.
Open tool
DeveloperJSON Tree Viewer
Collapsible JSON tree with search, JSONPath, type icons, and copy-by-node.
Open tool
DeveloperJSON Repair
Auto-fix broken JSON: trailing commas, single quotes, unquoted keys, comments, smart quotes, and NDJSON.
Open tool