This research presents a design of a thermal deformation errors compensation system for CNC machine tools which can compensate thermal deformation of Z-axis during the working time. The thermal deformation errors compensation system includes three instruments: displacement tester, temperature tester and thermal errors compensator. Displacement and temperature testers have been designed in the early researches, and the thermal errors compensator is designed in this research. The compensation process includes two parts, modeling part and compensation part. Modeling part focuses on making a model of thermal deformation, and compensation part focuses on using the model to compensate the thermal deformation of Z-axis during the working time.