JSON Merge
Combine two documents into one, see exactly which values disagreed and who won, or generate the RFC 7386 patch that turns one into the other.
Left document
Colorazione sintattica disattivata.
Right document
Colorazione sintattica disattivata.
Result
Colorazione sintattica disattivata.
The result appears here.
Conflicts
Points where the two sides disagreed appear here.
Funziona interamente nel tuo browser.
Su questo strumento
Merging two documents means deciding, key by key, what the result should hold when both sides have something to say about it. Deep merge recurses into a nested object present on both sides and combines it the same way; shallow merge treats a shared key as a single unit and lets one side replace the other wholesale, however deep that value goes. Where the two sides genuinely disagree, a priority setting decides which one is kept, right by default, since applying a second document on top of a first is the more common reading. Arrays are not objects, so they get their own choice: replace lets priority decide which array survives, concatenate appends the right array after the left one, concatenate unique does the same and then drops anything already equal to an earlier entry, and merge by key treats both arrays as tables, matching elements by one field and merging the matches while appending whatever had no match on either side. A conflict is reported only where a value was actually discarded, never for a key only one side had, and never for two numbers that just happen to be written differently, 1 and 1.0 read as the same value everywhere on this site. Generating a merge patch is a different operation with a fixed algorithm, RFC 7386, rather than the options above: it produces the smallest document that, applied to the left side by any conforming implementation, turns it into the right side. A key the left side had and the right side does not becomes null in the patch, which is also, unavoidably, what a key genuinely set to null becomes: the standard itself cannot tell the two apart, and this page cannot either.
Come usare
- Paste the left document, the one being merged into, on the left, and the one being applied on top of it on the right. Load the sample to see a conflict, an addition and a combined nested object at once.
- Choose deep or shallow merge, which side wins a real conflict, and how arrays at the same path should be combined.
- Press Merge. The result is on the right, and every point where a value was actually discarded is listed below it with both sides and which one was kept.