A novel algorithm for the ball-end mill relief using a five-axis computer numerical control (CNC) grinding machine and the simulation of the ball-end mill based on a CAM system is presented in this paper. In this study, In order to obtain an accurate normal relief angle, which is one of the key factors affecting tool cutting performance, a tool coordinate system based on the required relief angle and the cutting edge was established. Then, by the proposed tool coordinate system, an algorithm to determine the position between the grinding wheel and the tool is proposed, and then the relevant formulations are deduced. The coordinates of grinding point when the step of relief surface is grinded are calculated.Using the input data of a ball-end mill geometry, wheels geometry, wheel setting and machine setting, the NC code for machining will be generated. Then the code will be used as input to simulate the ball-end mill machining in 3 Dimension before real machining. The algorithm of ball-end mill relief can be authenticated by the 3D simulation system.