The principle of compensate the screw pitch error of CNC rotary table was introduced,as well as a pitch error measuring system based on autocollimator. Positioning accuracy of CNC rotary table equipped with HNC-818B system was detected,the pitch error of the CNC rotary table was compensated. The results show that the pitch error compensation can improve positioning accuracy and repeat positioning accuracy of NC rotary table.