The phase-shifting method is all along an important wavefront extraction technique in the interferometer. Moreover, to require almost real-time measurement an algorithm with a small number of grabbed buckets is very helpful to the phase-shifting interferometer. Therefore, those algorithms within five buckets are very practical and are given more attention. In the paper, popular phase shifting algorithms within five buckets are compared and new four and five buckets algorithms are developed to compensate for two dominate error sources which are linear phase shift deviation and detector nonlinearity. Numerical simulations and wavefront extraction experiment verify that the proposed compensation algorithms are insensitive to linear phase shift deviation and detector nonlinearity compared with classical four and five bucket algorithm. (C) 2013 Elsevier GmbH. All rights reserved.