The study of the explosion parameters of ethanol–air mixture at high pressure and temperature is essential for the safe production of ethanol. However, the explosion characteristics of ethanol vapor at various pressures and temperatures are limited. The mechanism at the flammability limits of ethanol has not been clarified, and the corresponding prediction model is also lacking. In this study, chemical kinetics and machine learning are used to study the mechanism of ethanol explosion and build predictive models, respectively. Our findings show that an increase in the initial pressure has a more pronounced influence on the explosion pressure (Pex) and pressure rise rate (dp/dt) than an increase of temperature. The variation trend of the upper flammability limit (UFL) of ethanol is related to the different effects of temperature and pressure on OH radicals. H + O2<>OH + O and HO2 + CH3<>OH + CH3O had the greatest effect on the generation of OH radicals. The quantitative relationship between the H, O, and OH radicals and UFL was constructed by machine learning, providing a new research perspective for the prediction of the UFL of an inflammable fuel under different pressures and temperatures. The results of the study will provide theoretical and practical guidance for the prevention and control of explosions in the ethanol production process.