BackgroundDiarrhea, the second leading cause of child morbidity and mortality worldwide, is responsible for more than 90% of deaths in children under 5 years of age in low and middle-income countries (LMICs). The high burden of diarrhea is mainly attributable to the limited access to improved water and sanitation. However, the impacts of improved sanitation and drinking water in preventing diarrheal diseases are not well understood. Therefore, this study estimated both the independent and joint effects of improved sanitation and water on diarrhea occurrence among rural under-five children in LMICs.MethodsThe current study utilized secondary data from the Demographic and Health Survey (DHS) datasets conducted between 2016 and 2021 in 27 LMICs. A total weighted sample of 330,866 under-five children was included in the study. We employed propensity score matching analysis (PSMA) to examine the effects of accessing improved water and sanitation on childhood diarrheal disease reduction.ResultsThe prevalence of diarrhea among children under 5 years of age in rural LMICs was 11.02% (95% CI; 10.91%, 11.31%). The probability of developing diarrhea among under-five children from households with improved sanitation and water was 16.6% (Average Treatment Effect on the Treated (ATT) = − 0.166) and 7.4% (ATT = − 0.074) times less likely among those from households with unimproved sanitation and water, respectively. Access to improved water and sanitation is significantly associated with a 24.5% (ATT = − 0.245) reduction of diarrheal disease among under-five children.ConclusionsImproved sanitation and drinking water source reduced the risk of diarrhea among under-five children in LMIC. The effects of both interventions (improved water and sanitation) had a larger impact on the reduction of diarrheal disease than the improvements to water or sanitation alone. Therefore, achieving Sustainable Development Goal 6 (SDG 6) is key to reducing diarrhea among rural under-five children.Supplementary InformationThe online version contains supplementary material available at 10.1186/s41182-023-00525-9.