Abstract In the process of modeling thermal errors in machine tools, optimizing the extraction of temperature information affects the prediction accuracy of the thermal error model. This paper proposes a thermal error modeling method based on factor extraction. Firstly, the temperature measurement points are optimized to determine the optimal number using finite element, fuzzy clustering, and correlation methods. Then, the common deformation factors in the machine tool temperature information are extracted through factor analysis, and they are used as independent variables for thermal error modeling. Finally, the method was applied to establish a model for thermal error model for a certain model of precision machine tool, and a regression model of the machine tool was obtained after factor extraction optimization, the effectiveness and feasibility of the proposed method in this paper were verified by comparing it with experimental data. The method proposed in this study provides a reference for modeling thermal errors in various types of machine tools in the future.