The transition towards advanced residential energy sources is a pressing priority for many countries. Despite this, solid fuels remain the dominant form of cooking energy for rural households in developing countries. This study investigates the physical and mental health impacts of cooking energy choices by using endogenous switching models to address selection bias associated with cooking energy adoption and to distinguish the health impacts of different types of cooking energy. Using a country-representative household survey data in China, our results indicate that adopting advanced forms of energy, not only enhances physical health in terms of reducing the rates of chronic diseases but also improves mental health. We further delve into the heterogenous impacts of advanced energy adoption across different groups and find that women, old adults, and economically disadvantaged groups are more likely to experience greater mental health benefits compared to their counterparts, while the opposite results are observed for the physical health. Additionally, we differentiate the health impacts by distinguishing between various energy types. This study provides insights for policy making aimed at improving public health and promoting health equality, contributing to efforts towards achieving sustainable development goals by prioritizing clean and efficient residential energy solutions.