The present study aims to establish a measurement method for the squareness error between the machine spindle and the machine table plane. The contact-type touch trigger probe is installed on the spindle of machine tool. When the probe ball touches the rectangle box, a signal is sent to the CNC system to record the space position of the spindle in the machine coordinate system. What this design is to pass to adopt three views of the spindle to determine its spatial location. In the light of the front view and the side view of the spindle, the tilt angle can be identified. According to the projection data, the perpendicularity of the spindle to the horizontal plane is adjusted until the tilt angle error decrease to zero. To verify this method, the corresponding tests are performed on five-axis CNC machine tool. The experimental results show that vertical error of the spindle is reduced by about 60 percent after the tilt angle is adjusted. Therefore, the proposed measurement and calibration method is effective in NC machine tool.