One major difficulty in the analysis of nucleic acids by electrospray mass spectrometry is represented by the affinity of the polyanionic sugar-phosphate backbone for nonvolatile cations, especially ubiquitous sodium and potassium ions. A simple on-line sample preparation system comprising a microflow pumping system and 45 x 0.8-mm-i.d. microcolumns packed with weak or strong cation-exchange resins is described for the efficient removal of cations from nucleic acid samples. Samples were analyzed by flow injection analysis at a 3-5 microL/min flow of 10 mM triethylamine in 50% water-50% acetonitrile. After on-line desalting, mass spectra of oligonucleotides revealed no significant sodium adduct peaks. Moreover, signal-to-noise ratios were greatly enhanced compared to direct injection of the samples. Electrospray mass spectrometry with on-line sample preparation allowed accurate molecular mass determinations of picomole amounts of crude oligonucleotide preparations ranging in size from 8 to 80 nucleotides within a few minutes. The good linearity of the calibration plot (R2 = 0.9988) over at least 2 orders of magnitude and a relative standard deviation in peak areas of less than 9% permitted the sensitive quantitative measurement of oligonucleotides in a concentration range of 0.2-20 microM with selected-ion monitoring. Finally, the on-line sample preparation system was evaluated for the mass spectrometric analysis of complex oligonucleotide mixtures.