Machine tool accuracy is the assurance of top-quality products in machining processes. In the all kinds of errors related to machine tools, thermal errors of machine tools' parts play an important role in machining accuracy and directly influence both the surface finish and the geometric shape of the finished workpiece. Therefore the objective of this work was to analyze the temperature field and thermal deformation in some parts of CNC machine tools. In this paper, the thermal boundary condition of main spindle and driving ball screw in CNC milling machine are discussed, some parameters in heat transfer process are calculated. Based on steady heat transfer process, the thermal analysis about spindle and ball screw is carried out under ANSYS environment, and their temperature fields are obtained when milling machine is working. Then the deformations of main spindle and ball screw are acquired by applying the thermal structure coupling element. Furthermore, in order to decrease main parts' deformations and improve the accuracy of CNC milling machine, some suggests are proposed.