Mass spectrometry is an analytical technique that identifies chemicals in a sample by measuring the mass-to-charge ratio of gas-phase ions. It works by generating molecular ions from the sample, which then fragment and are separated by their mass-to-charge ratio in the mass spectrometer. This produces a mass spectrum that displays ion abundance versus mass-to-charge ratio. Mass spectrometry is commonly combined with gas chromatography or liquid chromatography to first separate compounds before analysis. It has applications in structure elucidation, detection of impurities, and is a sensitive and specific technique used in many analytical laboratories.