A mass spectrometer of an ion trap type in which ions generated in an ion source (7) are confined in a space enclosed by a ring electrode (21) and end cap electrodes (22a, 22b). The amplitude of a high-frequency voltage applied to the ring electrode which defines this ion accumulating section is varied with respect to each ion accumulating section, whereby the ions are detected with a high sensitivity in a wide range of m/z (molecular weight of ions / valency of ions).