The Shack-Hartmann sensor uses a microlens array and a CCD camera for wave-front measurements. To obtain wave-front measurements with high accuracy, an accurate relative alignment of both is essential. The different states of misalignment of the Shack-Hartmann sensor are divided into groups and are treated theoretically and experimentally. Their effect on the accuracy of wave-front measurements is evaluated. In addition, a practical method for proper alignment of the Shack-Hartmann sensor is proposed. (C) 1998 Optical Society of America.