Video
A mass spectrometer converts molecules to ions, which are then accelerated and deflected by a magnetic field. The amount of deflection will vary based on its mass and charge.

One method of mass spectrometry
Mass spectrometry can be used to determine the amino acid sequence of a protein. The protein is first broken into smaller peptide fragments using enzymes. The peptides are run through the mass spectrometer and identified based on the mass/charge of known peptides. The complete protein sequence is inferred by assembling the peptide fragments.
