In this paper, the geometric error modeling method of CNC cylindrical grinder based on the differential motion relationship between coordinate systems, the function fitting model method of basic geometric error terms based on cftool toolbox and the error compensation method based on Jacobian matrix are proposed. Firstly, the differential motion theory, which is widely used in the field of robot kinematics error modeling, is used to build the machine tool space machining error model of CNC cylindrical grinder. Different from the multi-body theory, this modeling method can clearly reflect the influence degree of each moving part on the grinding wheel cutter. Secondly, SJ6000 laser interferometer was used to measure and identify the geometric error terms of B2-K3032 CNC precision cylindrical grinder. MATLAB cftool toolbox was used to perform mathematical function fitting on the known error data, and the mathematical relationship between 24 geometric errors and machining instructions was found. Finally, combining with the 24 Sum of Sine function model, the known verticality error and position deviation, the differential motion matrix of each moving part in the tool coordinate system and the corresponding Jacobian matrix, the compensation quantity (dx dz db dc) of the comprehensive geometric error in the tool coordinate system by the CNC precision cylindrical grinder is obtained. In order to verify the feasibility of the above method, RA1000 series roundness meter was used to measure the radial circular runout error before and after the correction. The experimental results show that the precision of each shaft section is increased by 17.54%, 15.22%, 15.71%, 18.4%, 12.87%, respectively, and the average machining accuracy is increased by 15.948%. Therefore, the above methods are effective and reasonable for improving the precision of spindle workpieces, and can also be used for reference in the initial design stage of CNC cylindrical grinder manufacturing enterprises or improving the machining accuracy of existing machine tools.