How does a Mass Spectrometer Work?

The mass spectrometer is used to identify the elemental composition of a substance. A sample of the substance is loaded into the spectrometer, where it is vaporized. The components are ionized, and the positive ions are accelerated by the use of a magnetic field. The mass-to-charge ratio of the ions is computed, and then they are compared and identified based on that ratio.