An electrostatic encoder comprising receiving coupling electrodes formed on a scale, and extending in a predetermined direction, transmitting coupling electrodes provided on a sensor head, and located to face the receiving coupling electrodes, digital electrodes provided on the scale to extend from the receiving coupling electrodes in a direction perpendicular to the predetermined direction, and arranged at a predetermined pitch, two pairs of interdigital electrodes provided on the sensor head, and located to face the digital electrodes, a voltage applying portion configured to apply an alternating voltage to the transmitting coupling electrodes, and a potential difference detecting portion configured to detect a potential difference between the interdigital electrodes of each of the two pairs of interdigital electrodes. The two pairs of interdigital electrodes are arranged at the same pitch, and the each pair of interdigital electrodes are spaced apart from each other by a predetermined distance in the predetermined direction.