Microbial electrosynthesis (MES) offers a promising pathway for CO 2 -based sustainable chemical production. However, the accurate prediction of product yields, notably acetate and ethanol concentrations, has been challenging. Here, we employed machine learning (ML) algorithms, including random forest, gradient-boosted decision trees, and eXtreme gradient boosting (XGBoost), to address this challenge. The models were trained on experimental data gathered by varying cathode material, pH, applied potential, temperature, and inorganic carbon (IC) concentrations and exhibited proficiency in predicting acetate and ethanol concentrations. After hyperparameter optimization, XGBoost demonstrated the highest accuracy in predicting both acetate (R 2 = 0.877) and ethanol (R 2 = 0.647) concentrations. By adopting a two-stage modeling approach where predicted concentrations of acetate and total organic carbon (TOC) feed into ethanol concentration predictions, we further enhanced XGBoost's performance in predicting ethanol concentrations. The resulting twostage XGBoost model showcased R 2 values of 0.998 for training and 0.727 for testing in ethanol predictions. Feature importance assessments revealed that features such as current, pH, and IC were paramount, with the two-stage XGBoost model highlighting the importance of IC, TOC, and pH in predicting ethanol concentrations. In contrast, traditionally significant features like applied potential and temperature exhibited diminished influence. This study not only demonstrates the promising ability of ML, especially XGBoost, to advance MES optimization and uncover insights into factors influencing MES but also offers the potential for enhancing MES performance through timely operational adjustments in the future. Therefore, these findings are crucial for refining and optimizing sustainable chemical production.