Mass spectrometry is a technique that ionizes chemical compounds and separates and identifies ions based on their mass-to-charge ratios. It can provide both qualitative and quantitative information about molecular structures. During analysis, molecules are bombarded by electrons which produces molecular ions and fragment ions. These ions are then separated by their mass in electric and magnetic fields. By analyzing the masses of molecular and fragment ions, mass spectrometry can determine molecular formulas and elucidate molecular structures. It is a highly sensitive technique that is widely used for molecular identification.