How to use the JSON merger
- Paste the base document into First JSON (base).
- Paste the overrides into Second JSON (overrides).
- Choose how Arrays combine: Replace, Concatenate, Concatenate without duplicates or Merge item by item.
- Choose which side On conflict keep: Second (the default) or First.
- Pick an Indent and copy the Merged JSON. A table below lists each conflicting value and which one was kept.
What it does and when to use it
Layered configuration is common: a default.json with every setting, then a production.json that changes a few. Libraries such as node-config, Spring profiles and Helm values files all merge this way. This tool shows what the final, merged config will look like before you deploy, and the conflict table tells you exactly which settings the override file changes.
It also helps when you combine two partial API responses, add new translation keys to an existing language file, or check what a “deep merge” call in your code will produce. Set On conflict keep to First to fill in only missing keys without touching existing values.
To see what differs between two documents without merging them, use JSON diff. After merging, sort the keys with the JSON key sorter or validate the result with the JSON Schema validator.
How it works
Both documents are parsed in your browser. The merge starts from a copy of the first. For each key in the second: if the key is new, it is added; if both values are objects, they are merged the same way, one level down; if both are arrays, your array option decides; otherwise, if the values differ, it is a conflict and the side you chose wins. Key order follows the first document, with new keys from the second added at the end of each object. Duplicate checks for arrays compare items by their JSON text, so {"a":1} and {"a":1} count as equal.
Worked examples
The default sample, merged with the second document winning:
{"name":"api","server":{"port":9090,"host":"0.0.0.0","tls":true},"features":["search"],"debug":false}
Path | First | Second | Kept
server.port | 8080 | 9090 | second
features | ["auth"] | ["search"] | second
host survives from the base, tls and debug are added, and the features list is replaced.
Merge item by item on worker settings: base [{"name":"a","threads":2},{"name":"b","threads":2}], override [{"threads":8}] gives [{"name":"a","threads":8},{"name":"b","threads":2}].
Limits and tips
- Item-by-item merging pairs by position, not by an id field. If the lists are in a different order, the wrong items are merged.
- Merging is two-way only; there is no three-way merge with a common ancestor, as Git does.
Frequently asked questions
Does a null in the second document delete the key?
Which array option should I choose?
What counts as a conflict?
Can I merge more than two files?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.