A novel two-step phase-shifting algorithm for use in detecting wavefront phase is presented. This algorithm is very insensitive to detuning. The short time needed to acquire and process interferograms helps to minimize phase errors caused by vibration, temperature effects, and nonlinear errors of the piezoelectric transducer. The rms error due to detuning does not change as in classical phase-shifting algorithms with respect to the selected ideal phase shift. The resulting wrapped phase is modulo 2π. Finally the phase error is analyzed. © 2003 Society of Photo-Optical Instrumentation Engineers.