A method for the phase correction of interferograms in Fourier transform infrared spectroscopy is presented. It is shown that phase error can be canceled to within an arbitrary angular precision by a low-order digital all-pass filter. Such a filter only modifies the phase of the Fourier transform of the interferogram and keeps the magnitude unchanged, like the Mertz method, for example. However, our method minimizes the asymmetric apodization that results in photometric errors when using the Mertz method alone. A practical example is provided in which phase correction over a frequency range of 800 cm(-1) to 4000 cm(-1) using a 9-pole all-pass filter resulted in a photometric error of <0.01%, much less than the 0.3% error of the Mertz method. An alternative and faster (approximately 100 ms) approach is to use an all-pass filter with lower angular precision followed by the Mertz method. Removing most of the phase error with the filter brings the interferogram to an optimal state so that the residual phase error can be completely removed with the Mertz procedure without introducing photometric error. The method can be used in most experiments, including emission spectroscopy, where conventional techniques are inadequate. A simple all-pass filter design algorithm is given.