Merge JSON objects
Apply an override object while retaining untouched nested keys.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Merge two JSON objects for layered configuration. The second object takes priority: matching objects combine recursively, while arrays, scalars and null replace the earlier value. Check the replacement paths before copying the result.
How to use this tool
- Paste the base and override JSON objects, or choose two JSON files in that order.
- Check that both inputs are objects. Review the paths replaced by the second object and any array conflicts.
- Merge the objects, inspect the JSON preview, then copy or download the complete result.
Supported inputs and limits
Both top-level inputs must be JSON objects with unique keys. Matching nested objects combine recursively; arrays and other values are replaced by the second input.
A null in the second object is kept as null; it does not delete a key. This is a recursive object merge, not RFC 7396 JSON Merge Patch.
Paste two objects (up to 1 MiB each) or choose exactly two UTF-8 JSON files (up to 10 MiB each). JSON has a 200,000-node and 128-level limit; output is limited to 20 MiB. Numeric tokens are preserved.
Files and input are processed in this browser. No account needed.
Worked example
Example input
{"a":1,"settings":{"color":"green"}}Example options
{"settings":{"size":2}}Example output
{
"a": 1,
"settings": {
"color": "green",
"size": 2
}
}When something does not work
If a merge cannot run, check that both inputs are JSON objects with unique keys. File mode requires two UTF-8 files in base-then-override order.
Frequently asked questions
Which input wins when keys overlap?
The second input wins. If both values are objects, their keys merge recursively; an array, scalar or null in the second input replaces the whole first value.
Does null remove a key?
No. This tool retains null as a value. RFC 7396 JSON Merge Patch uses null for removal, so use a patch tool if you need deletion semantics.
Can I merge two JSON files?
Yes. Choose file input and add exactly two UTF-8 JSON files. The first is the base and the second overrides it. You can reorder the files before running.
Why was my JSON rejected?
Both top-level values must be objects. Invalid JSON, duplicate object keys, unsupported UTF-8 and size or nesting limits are rejected.
Is my input sent to a server?
No. Tool input is processed in your browser, not sent to a server. Temporary workspaces stay in the same tab and are cleared by a refresh or tab closure. Save the results you need.