The moving error in the grating interferometer can change interference fringes according to the principle of half-wave phase difference plane. In this paper the moving error formula for grating interferometer is derived. It may provide a basis for designing and using the grating interferometer.