This paper introduces the algorithm structure, principle and method of the evaluation of the flatness error based on genetic algorithm. Detailedly describes how to use genetic algorithm based on real number encoding to evaluate the flatness error and gives algorithm process.MATLAB’s GA algorithm toolbox is used to evaluate the flatness error. Describes and explains the parameter setup of every step detailedly and compiles M-file used of algorithm of fitness function. The structure which is carried out by the simulation is satisfying. Simulation process and the results prove that it’s right to use genetic algorithm based on real number encoding to evaluate the flatness error to calculate convergence.It can get the result rapidly and ideally.