In electrospray ionization MS (ESI-MS), ions are produced by the addition of a proton ([M+H]+). However, in cases where the analyte molecule is already charged, e.g. quaternary amine salts, the resulting ion may be an M+ ion.
Two ESI+ mass spectra are shown below. To test whether the molecular ion is M+ or M+H+, deuterium is added to the sample and the data is recollected. If the ion peak does not change in position relative to the original MS, the ion peak is considered an M+ and not M+H+.
Note: the deuterium exchange test may also occur with OH/NH/SH groups too. It is best to have a fair idea of the structure prior to performing this test.