To increase quality, reduce cycloidal gear noise, and avoid unnecessary vibration and shock, a compensation of axial geometric errors method is proposed based on the cycloidal gear form grinding. In the process of machining cycloidal gears, the relative position relationship between the grinding wheel and workpiece is affected by geometric errors of the motion axes, which has serious effects on the surface accuracy of the cycloidal gears. Combined with cycloidal gear form grinding kinematic principles, a geometric error model for each axis of a four-axis computer numerical control form grinding machine is established. By changing the compensation value of the geometrical errors on six degrees of freedom, the error of the cycloid gear tooth surface machined is obtained. Based on a sensitivity analysis of geometrical errors of each axis, the corrections are determined through an optimization process that targets the minimization of the tooth flank errors. The geometric errors of each axis of the cycloid gear grinding machine are compensated, and then, the cycloid gears produced by the machine are processed. Through the processing experiment, the error data of the actual processing before and after the compensation are compared, which indicates that the machining accuracy of the cycloid gear grinding machine is obviously improved. It has an important guiding significance in improving the precision and performance of large CNC form gear grinding machines.