Mass spectrometry allows determination of molecular mass, molecular formula, and some structural features. It works by vaporizing and ionizing a sample using electron bombardment, which knocks an electron off each molecule to produce a molecular ion. The mass spectrometer then separates the ions based on their mass-to-charge ratio, which allows identification of the molecular ion peak corresponding to the molecular weight. Isotope peaks from elements like carbon can provide structural information. Fragmentation patterns are also used for structural analysis.