A mass spectrometer is a device that determines what elements and isotopes are present in a sample. Element refers to the type of atom, such as hydrogen, carbon, iron, etc. Isotopes are atoms of the same element but with different numbers of neutrons. Mass spectrometers are sometimes used in forensic science when detectives find an unknown substance at a crime scene and need to figure out what it might be.
Elements to be identified are processed so that an electron is removed from each atom, making the atom have a net positive charge equal to the charge on a single proton. The elements are accelerated to high speeds and passed through a velocity selector, which uses a combination of electric fields and magnetic fields to only allow atoms through with a particular velocity. See http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/maspec.html#c3 (Links to an external site.) for information on how a velocity selector works.
From the velocity selector, the beam of isotopes enters the main chamber, where a magnetic field applies a force that turns each isotope in a circle until it collides with a particle detector that measures the radius of the circle. Heavier isotopes travel along a circle with a longer radius, making it possible to calculate the exact mass of each isotope.