Mass spectrometry is a technique that ionizes chemical compounds and sorts the ions based on their mass-to-charge ratio. It can be used to determine molecular weights, identify organic and inorganic compounds, and analyze complex mixtures. The key components of a mass spectrometer are an ion source that ionizes samples, a mass analyzer that separates the ions by mass, and a detector that records the results as a mass spectrum. Common applications of mass spectrometry include molecular structure determination, quantitative analysis of mixtures, and identification of unknown compounds.