In this study, direct analysis in real time adduct selectivities of a 558 in-house high-resolution mass spectrometry sample library was evaluated. The protonated molecular ion ([M + H]) was detected in 462 samples. The ammonium adduct ion ([M + NH]) was also detected in 262 samples. [M + H] and [M + NH] molecular ions were observed simultaneously in 166 samples. These adduct selectivities were related to the elemental compositions of the sample compounds. [M + NH] selectivity correlated with the number of oxygen atom(s), whereas [M + H] selectivity correlated with the number of nitrogen atom(s) in the elemental compositions. For compounds including a nitrogen atom and an oxygen atom [M + H] was detected; [M + NH] was detected for compounds including an oxygen atom only. Density functional theory calculations were performed for selected library samples and model compounds. Energy differences were observed between compounds detected as [M + H] and [M + NH], and between compounds including a nitrogen atom and an oxygen atom in their elemental compositions. The results suggested that the presence of oxygen atoms stabilizes [M + NH], but not every oxygen atom has enough energy for detection of [M + NH]. It was concluded that the nitrogen atom(s) and oxygen atom(s) in the elemental compositions play important roles in the adduct formation in direct analysis in real time mass spectrometry.