Mass spectrometry (MS) is an analytical technique that ionizes chemical species to determine their mass-to-charge ratio, enabling the analysis of elemental compositions and molecular structures. The mass spectrometer comprises an inlet system, ion sources, mass analyzers, detectors, and a vacuum system, each performing specific functions to generate and analyze ions. Applications of MS span various fields, including pharmaceuticals, environmental analysis, and forensic science.