A mass spectrometer is an analytical device that measures the mass-to-charge ratio of charged particles. Through this measurement, it identifies and quantifies molecules in a sample based on their mass. The instrument consists of three main components: an ion source, a mass analyzer, and a detector.