A new hardware compensation method reducing displacement measurement errors, caused by tilt of index scale in moire linear encoders, has been developed. In conventional moire linear encoders, the detectors are aligned perpendicular to the line of moire fringes this structure is very sensitive to an unwanted tilt of the gratings. In this paper, a newly designed grating, called a phase-modulated grating, is developed to compensate for non-orthogonal errors. By using the phase-modulated grating instead of a conventional index, it is possible to reduce non-orthogonal errors of moire linear encoders.