This paper describes the application of the genetic algorithm (GA) coupled with full factorial design of experimental technique to optimize the parameters of the carbon nanotube (CNT) mixed with dielectric fluids in electrical discharge machining (EDM). The multiwall CNT is mixed with dielectric fluids to analyse the surface roughness and microcracks using atomic force microscope. Response surface model have been developed to predict the surface roughness of EDM parameters. Analysis of variance and F-test have been used to check the validity of response surface model and to determine the significant process parameter affecting the surface roughness. GA is used to optimize the process parameters during EDM of AISI D2 tool steel material with CNT-based machining. The developed mathematical model was further coupled with GA to find out the optimum conditions leading to the minimum surface roughness value.