An automated system is described for computer examination of the mass spectrum of an unknown mixture for the presence of a specific compound. The probability that the compound is present is indicated as a ‘confidence index’ K; 2K should signify the average number of compounds, selected at random, whose mass spectra would have to be examined to find data which match the target spectrum to the same degree as does the unknown. The value of K is determined by the uniqueness U of the m/e value, the abundance A, and the criterion of abundance agreement W of the matching peaks, and of the compound concentration D in the sample. Application to spectra from a variety of compounds, including illicit drugs, indicates that the system has high sensitivity and selectivity, and that the value of K is a useful index of the reliability of the identification. Initial testing of this system has utilized an automated quadrupole mass spectrometer under control of a dedicated microcomputer with sample introduction through a flash evaporator and membrane separator.