About JSON Merge
JSON Merge combines two JSON objects into one, with the second object taking priority. It is the quick way to layer defaults and overrides - keep a base configuration and apply a patch on top - and the result comes back pretty-printed for reading.
Give it a base JSON and an overlay JSON, and the tool spreads the two top levels together. Where a key appears in both, the overlay value replaces the base value, so merging a equals one, b equals two with b equals three, c equals four yields a equals one, b equals three and c equals four.
The key word is shallow. The merge only combines the top level, so a nested object in the overlay replaces the whole nested object in the base rather than being merged field by field, and arrays are overwritten rather than concatenated. Malformed JSON on either side throws a raw parse error rather than returning a friendly message, so both inputs need to be valid before the tool will run.
How to use JSON Merge
- 1 Paste the base object into the Base JSON field.
- 2 Paste the object to layer on top into the Overlay JSON field.
- 3 Run the tool to read the merged result, pretty-printed with two-space indentation.
Frequently asked questions
Which object wins when a key appears in both?
The overlay wins. Its value replaces the base value for any shared key, while keys unique to either object are kept.
Does it merge nested objects deeply?
No. The merge is shallow, so a nested object in the overlay replaces the entire matching nested object in the base rather than combining their fields one by one.
What happens to arrays?
They are overwritten, not concatenated. If the overlay provides an array for a key that is also an array in the base, the overlay array replaces it entirely.
What happens if my JSON is malformed?
The tool throws a raw parse error rather than returning a friendly message. Both sides must be valid JSON for the merge to succeed.
Free, online, and private
Free to use
JSON Merge is completely free. There is no account to create, no login, and no hidden charge or usage limit.
Runs online in your browser
It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.
Your data stays private
All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.
How JSON Merge behaves in detail
These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.
| Parameter | Value |
|---|---|
| Input | two textareas - a Base JSON starting at a and b, and an Overlay JSON starting at b and c |
| Output | the two objects merged and pretty-printed with two-space indentation |
| Overlay wins | where a key appears in both, the overlay value replaces the base value |
| Default | merging a equals one, b equals two with b equals three, c equals four yields a equals one, b equals three, c equals four |
| Depth | the merge is shallow - the two top levels are combined with a spread |
| Format | the result is re-serialized with two-space indentation |
Compiled from the implementation of this tool and checked against it by itoolnet.
What JSON Merge does not do
Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.
- The merge is shallow, not deep. Nested objects are replaced whole rather than merged field by field, so an overlay with a nested object wipes out the entire corresponding nested object in the base.
- Malformed JSON is not handled gracefully. If either side does not parse, the tool throws rather than returning an error message, so the page reports the raw parse failure.
- Arrays are overwritten, not concatenated. There is no option to combine arrays, to choose deep or shallow merging, or to control the order or formatting of the output beyond the fixed indentation.
Tested and documented by itoolnet, the team that builds and maintains this site.