The invention relates to a method for producing epoxy fatty acid methyl ester by using illegal cooking oil, which comprises: subjecting illegal cooking oil and methanol to esterification to obtain fatty acid methyl ester; purifying the fatty acid methyl ester by molecular distillation and performing epoxidation; and subjecting the obtained crude fatty acid methyl ester to three-stage rectification to obtain three models of epoxy fatty acid methyl ester. In the invention, illegal cooking oil is used as a raw material, and esterification is performed under normal pressure; as the reaction temperature is higher than the boiling point of methanol, the methanol is gasified immediately upon contact with fat; and the methanol is uniformly, quickly and fully contacted with the fat, so the esterification speed is further improved. When the method is used, the illegal cooking oil waste is utilized, cost is saved, environment is protected, energy consumption is low, process is simple, operation is safe and product quality is high. Therefore, the method is a resource-saving and environment-friendly production method. The epoxide number of the obtained No.1 epoxy fatty acid methyl ester is 4.0to 5.0, the plasticizing effect of the epoxy fatty acid methyl ester is desirable, the acid value is smaller than 1, the saponification of plasticized products is avoided, a flashing point is above 180 DEG C, an iodine value is smaller than 3, and the epoxy fatty acid methyl ester passed the verification of quality supervision and inspection departments and are approved to be qualified.