JSON Merge
Merge multiple JSON objects into one
Input (Array of JSON objects)
Merged Output
Paste your (array of JSON objects) on the left and the result shows up here.
Or drop a file on this box, , or .
What is JSON Merge?
Need to combine multiple JSON objects into one? This tool merges multiple JSON (JavaScript Object Notation) objects into a single unified object. Great for combining config files, merging API responses, or consolidating data from different sources.
Pick Deep or Shallow. Deep merge walks into nested objects and combines them key by key, the way Object.assign would if it went all the way down. Shallow merge is exactly Object.assign({}, ...objects): a nested object from a later item replaces the earlier one wholesale. In both modes, arrays are replaced, not concatenated or merged by index, and the last object wins on any conflict. That's also how JSON Merge Patch (RFC 7386) treats arrays, if you've worked with PATCH APIs. The output is plain RFC 8259 JSON, with big integers kept exact.
Everything happens in your browser, so your JSON never leaves your computer. The output updates as you type or switch modes.
How to Use the JSON Merge
Order matters more than anything else on this page: the objects are folded together from first to last, so put your base config first and the overrides after it. The merged result refreshes whenever the input or the mode changes.
Paste Array of JSON Objects or Upload
Wrap the objects in one outer [ ] in the Input panel, or skip the brackets and give each object its own line, NDJSON style. Upload reads either shape from a file, and Sample loads a plan template followed by a subscriber's overrides. The shape it expects:
[{"plan": "Basic", "settings": {"roaming": false, "dataCapGb": 5}}, {"subscriberId": "SUB-1001", "settings": {"roaming": true}}] Later objects override earlier ones when keys conflict. Every item must be an object; a string, number or array in the list gets a clear error instead of a strange result.
Choose Deep or Shallow Merge
Click Deep (default) to recursively merge nested objects – values from later objects merge into earlier ones. Click Shallow to overwrite nested objects entirely. The right Merged Output panel updates automatically.
Copy or Download
Check the merged result in the output panel, then grab it with "Copy" or keep a file of it with "Download".
When You'd Actually Use This
Config File Merging
Merge default configuration with environment-specific overrides. Deep merge preserves nested settings while allowing selective overrides.
API Response Combination
Combine multiple API responses into a single object. Useful when you need to aggregate data from different endpoints.
Data Consolidation
Merge JSON exports from different sources. Combine user data, settings, or preferences into unified objects.
Object Composition
Build complex objects by merging simpler ones. Great for creating default objects and then adding specific properties.
Common Questions
Is my JSON data stored?
No. The merge is a small recursive function in this page's script, and this page offers no way to save or publish what you paste, so your config files go nowhere.
What's the difference between deep and shallow merge?
Deep merge recursively combines nested objects. Shallow merge replaces them. With the sample, deep merge keeps settings.dataCapGb: 5 from the defaults while taking settings.roaming: true from the override. Shallow merge gives you only the override's settings object, so dataCapGb is gone.
What happens with conflicting properties?
Properties from later objects override properties from earlier ones. The last object in the list wins for any conflicting key.
Can I merge arrays?
No. Arrays are values like any other: if two objects both have an items array, the later one replaces the earlier one entirely, in both modes. The list you paste is the list of objects to merge, so it has to contain objects only.
What if objects have different structures?
The merge combines all properties from all objects. Properties that exist in one object but not others are preserved. The result contains all unique properties. To look the merged object over field by field, paste it into the JSON parser online, which lays it out as a table.
Does it work with invalid JSON?
No. If the whole input does not parse, the page retries it one line at a time, so the error you see is about the first line that fails, which is handy for finding the broken object in a long list. To pin down the exact character, run that object through the JSON Validator, or let the JSON Fixer repair it.
Other JSON Tools You Might Need
A merged config is only as good as the pieces that went in. Check or repair those pieces first, then format the result, export it as YAML, or generate a schema from it so the next override is checked automatically: