A 4+1 phase shifting algorithm is proposed for rotating-compensator spectroscopic ellipsometry (RCSE). The spectroscopic ellipsometric parameters are determined with five spectra, taken when the compensator is rotated at the detection angles of 0°, 45°, 90°, 135°, and an additional detection angle of 22.5°. Both fundamental and second harmonic frequency components of the RCSE spectra can be determined by the new phase shifting algorithm. Also, there is no need to take the dark spectrum of the spectrometer for error correction using the new method, compared to Lee's method which also utilizes five spectra for RCSE.