The contour error of the machined parts is an important index to evaluate the accuracy of CNC machining. Considering multi-axis servo control system, a predictive compensation strategy for contour error is presented in this paper. First, the offline identification method is adopted to establish the transfer function of each motion system. In this case, the relationship between the interpolation command and the feedback position of the grating is determined for the selected machine tool. Thus, before machining, the trajectory information of each motion axis can be predicted according to the interpolation instruction and the transfer relationship. It can be converted into the contour trajectory of the part through kinematic analysis, so as to predict the contour error. Finally, the predicted contour error is compensated into the command trajectory to ensure the contour accuracy of the part to be machined. Compared to existing methods, our method can effectively reduce the trial-produced cycle of parts and avoid unnecessary waste of processing materials. Moreover, without increasing the complexity of the control system and greatly reducing the machining efficiency, the dynamic error caused by the dynamic characteristics of the shaft is reduced. Taking the starfish pattern and the contour line of the impeller as the milling processing experiment case, the contour error after compensation is greatly reduced compared with the contour error processed by the original command. Therefore, the predictive compensation method proposed in this paper can significantly improve the machining accuracy. In addition, it also has application value for trial production of complex curved parts.