An X-ray fluorescence spectrometer comprising: an X-ray source configured to irradiate a sample with primary X-rays; a spectroscopic device configured to monochromate secondary X-rays generated from the sample; a detector configured to receive the secondary X-rays monochromated by the spectroscopic device and generate a number of pulses proportional to intensities of the secondary X-rays, the pulses having pulse heights proportional to energy of the secondary X-rays; an interlocking unit configured to interlock the spectroscopic device and the detector so as to change wavelengths of the secondary X-rays entering the detector, a multichannel pulse height analyzer configured to separate the pulses generated in the detector in accordance with a plurality of pulse height ranges and count the pulses in the respective pulse height ranges to output a differential curve that is a distribution of the intensities of the secondary X-rays against the pulse heights; and a qualitative analysis unit configured to simultaneously generate, for the secondary X-rays entering the detector at the wavelengths changed by the interlocking unit, an analytical pulse height width profile and a narrow pulse height width profile that are distributions of the intensities of the secondary X-rays against scan angles 2θ set by the interlocking unit on the basis of the differential curve which is output by the multichannel pulse height analyzer, as well as a predetermined analytical pulse height width, corresponding to a pulse height width appropriate for cases where there is no higher order reflection line appearing at a close scan angle 2θ to that of an analytical line, for an analytical line that is a primary reflection line and a predetermined narrow pulse height width, corresponding to a pulse height width appropriate for cases where there is a higher order reflection line appearing at a close scan angle 2θ to that of an analytical line, that is narrower than the analytical pulse height width, wherein the qualitative analysis unit identifies the analytical lines in the analytical pulse height width profile and the narrow pulse height width profile and adds any analytical line identified only in the narrow pulse height width profile to the analytical lines identified in the analytical pulse height width profile to obtain an identification result of the analytical lines. an X-ray source configured to irradiate a sample with primary X-rays; a spectroscopic device configured to monochromate secondary X-rays generated from the sample; a detector configured to receive the secondary X-rays monochromated by the spectroscopic device and generate a number of pulses proportional to intensities of the secondary X-rays, the pulses having pulse heights proportional to energy of the secondary X-rays; an interlocking unit configured to interlock the spectroscopic device and the detector so as to change wavelengths of the secondary X-rays entering the detector, a multichannel pulse height analyzer configured to separate the pulses generated in the detector in accordance with a plurality of pulse height ranges and count the pulses in the respective pulse height ranges to output a differential curve that is a distribution of the intensities of the secondary X-rays against the pulse heights; and a qualitative analysis unit configured to simultaneously generate, for the secondary X-rays entering the detector at the wavelengths changed by the interlocking unit, an analytical pulse height width profile and a narrow pulse height width profile that are distributions of the intensities of the secondary X-rays against scan angles 2θ set by the interlocking unit on the basis of the differential curve which is output by the multichannel pulse height analyzer, as well as a predetermined analytical pulse height width, corresponding to a pulse height width appropriate for cases where there is no higher order reflection line appearing at a close scan angle 2θ to that of an analytical line, for an analytical line that is a primary reflection line and a predetermined narrow pulse height width, corresponding to a pulse height width appropriate for cases where there is a higher order reflection line appearing at a close scan angle 2θ to that of an analytical line, that is narrower than the analytical pulse height width, wherein the qualitative analysis unit identifies the analytical lines in the analytical pulse height width profile and the narrow pulse height width profile and adds any analytical line identified only in the narrow pulse height width profile to the analytical lines identified in the analytical pulse height width profile to obtain an identification result of the analytical lines.