An X-ray fluorescence spectrometer, comprising: an X-ray source configured to irradiate a sample with primary X-rays; a spectroscopic element configured to disperse secondary X-rays generated from the sample; an energy-dispersive detector configured to measure an intensity of the secondary X-rays; a retracting mechanism configured to retract the spectroscopic element from a path of the secondary X-rays; a scanning mechanism, which is configured to move the energy-dispersive detector between an auxiliary measurement area for measuring the secondary X-rays in a state where the spectroscopic element is retracted by the retracting mechanism and a main measurement area for measuring the secondary X-rays dispersed by the spectroscopic element, and is configured to change an angle of the spectroscopic element so that the secondary X-rays dispersed by the spectroscopic element enter the energy-dispersive detector in the main measurement area; a storage device configured to store, in advance, a ratio between a background intensity of the secondary X-rays measured in the auxiliary measurement area and a background intensity of the secondary X-rays dispersed by the spectroscopic element, which is measured in the main measurement area; and an arithmetic device, which is configured to calculate a background intensity included in a measured intensity in the auxiliary measurement area through waveform separation, and is configured to perform correction and quantitative analysis, the correction including subtracting a value, which is obtained by multiplying the calculated background intensity corresponding to energy of an analysis line by the ratio, from a measured intensity of the analysis line in the main measurement area, wherein the scanning mechanism is configured to move the energy-dispersive detector between the auxiliary measurement area and the main measurement area so as to share the energy-dispersive detector and the scanning mechanism that are used for measurement in the main measurement area and the energy-dispersive detector and the scanning mechanism that are used for measurement in the auxiliary measurement area. an X-ray source configured to irradiate a sample with primary X-rays; a spectroscopic element configured to disperse secondary X-rays generated from the sample; an energy-dispersive detector configured to measure an intensity of the secondary X-rays; a retracting mechanism configured to retract the spectroscopic element from a path of the secondary X-rays; a scanning mechanism, which is configured to move the energy-dispersive detector between an auxiliary measurement area for measuring the secondary X-rays in a state where the spectroscopic element is retracted by the retracting mechanism and a main measurement area for measuring the secondary X-rays dispersed by the spectroscopic element, and is configured to change an angle of the spectroscopic element so that the secondary X-rays dispersed by the spectroscopic element enter the energy-dispersive detector in the main measurement area; a storage device configured to store, in advance, a ratio between a background intensity of the secondary X-rays measured in the auxiliary measurement area and a background intensity of the secondary X-rays dispersed by the spectroscopic element, which is measured in the main measurement area; and an arithmetic device, which is configured to calculate a background intensity included in a measured intensity in the auxiliary measurement area through waveform separation, and is configured to perform correction and quantitative analysis, the correction including subtracting a value, which is obtained by multiplying the calculated background intensity corresponding to energy of an analysis line by the ratio, from a measured intensity of the analysis line in the main measurement area, wherein the scanning mechanism is configured to move the energy-dispersive detector between the auxiliary measurement area and the main measurement area so as to share the energy-dispersive detector and the scanning mechanism that are used for measurement in the main measurement area and the energy-dispersive detector and the scanning mechanism that are used for measurement in the auxiliary measurement area.