Thermal errors of CNC machines have significant effects on precision of a workpiece. One of the approaches to reduce these errors is modeling and on-line compensating them. In this study, thermal errors of an axis of the machine are modeled by means of artificial neural networks along with fuzzy logic. Models are created using experimental data. In neural networks modeling, MLP type which has 2 hidden layers is chosen and it is trained by backpropagation algorithm. Finally, the model is validated with the aid of calculating mean squared error and correlation coefficients between outputs of the model and a checking data set. On the other hand, an adaptive neuro-fuzzy inference system is utilized in fuzzy modeling which uses neural network to develop membership functions as fuzzifiers and defuzzifiers. This network is trained by hybrid algorithm. At the end, model validation is done by mean squared error like previous method. The results show that the errors of both modeling techniques are acceptable and models can predict thermal errors reliably.