Mass spectrometry is a technique that uses the deflection of charged particles by a magnetic field to determine the relative masses of molecular ions and fragments. It provides a great deal of information from small samples and can be used to determine molecular mass, structure, and purity. Various ionization sources like electron ionization, chemical ionization, fast atom bombardment, and matrix-assisted laser desorption/ionization are used to vaporize and ionize samples for analysis in mass analyzers such as quadrupoles, ion traps, and time-of-flight instruments. Mass spectra provide the abundance of ions as a function of their mass-to-charge ratio and can reveal molecular structure through characteristic fragmentation patterns.