Merge JSON Objects
Merge two JSON objects together. Runs entirely in your browser, so your data never leaves your device.
Drop a file here, or click to browse
Files never leave your device
Drop a file here, or click to browse
Files never leave your device
Output
The result appears here as you type.
How to use Merge JSON Objects
- 1. Add two JSON object files. Drop or browse for the two .json files whose objects you want deep-merged. The second file's values take priority wherever both files define the same key.
- 2. Choose how to handle Arrays. Pick Replace so an array in the second file fully overwrites the same key's array in the first, or Concatenate to join both arrays together instead.
- 3. Pick an indent. Choose 2 spaces, 4 spaces or tabs for the merged file so its formatting matches the files being combined or the destination it will be saved to.
- 4. Download the merged file. Download the resulting object, which combines both files recursively, keeping every key from each and resolving conflicts according to your Arrays setting.
When to use Merge JSON Objects
Merge JSON Objects deep-merges two JSON object files together, combining nested keys rather than just overwriting one file with the other. It is for layering configuration or settings from two sources into a single, complete object.
- Layering an environment override on a base config. A base config.json holds shared defaults, and an environment-specific file overrides just the database host and port. Merge them to get the final config for that environment.
- Combining defaults with user preferences. An application ships a default settings object, and each user has a smaller file of saved preferences. Merge the two to get the complete settings for that user.
- Combining partial API mocks. Two team members each wrote a partial mock response covering different fields of the same object, and you need one complete mock that includes both sets of fields.
- Applying a theme override on a base theme. A base theme JSON defines default colors and spacing, and a smaller override file customizes just a few values. Merge them to produce the final theme file.
Examples
Deep-merge two configs
Input
a.json {"db": {"host": "x"}} and b.json {"db": {"port": 5}}Output
{
"db": {
"host": "x",
"port": 5
}
}About the Merge JSON Objects tool
Merge JSON Objects does its work locally, right in the browser. Merge two JSON objects together. There is no upload step, no queue and no account, and your data never travels over the network.
It belongs to the JSON Tools collection on EditSafely, a set of 90 small, focused JSON utilities that share the same instant, private workspace.
You can shape the output with 2 settings, including Arrays and Indent, and the result refreshes the moment you change one. The finished file is put together in browser memory and saved with the Download button, so it never touches a server on the way to your disk. A worked example further down the page shows exactly what the tool produces for a real input.
Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.
Frequently asked questions
Is Merge JSON Objects free to use?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Are my files uploaded to a server?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
Which files does Merge JSON Objects accept?
It accepts JSON files. There is no file size cap imposed by a server; very large files are limited only by your device's memory.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I save the output?
Click the Download button once the result is ready. The file is built in your browser's memory and handed straight to your downloads folder, without passing through a server.