Clean water provision remains a serious problem in low- and middle-income countries. In 2017, about 30% of the world population relied on unimproved water sources located outside of the dwellings. Often women and children are occupied in fetching water. This situation increases the prevalence of water-related diseases such as diarrhoea and reduces children's study time. School attendance may decrease due to the combined effects of diarrhoea and time spent on fetching water. We investigate the effects on school absenteeism and primary school enrolment in Indonesia, using a panel data set for 295 districts over the period 1994–2014. Districts with higher diarrhoea prevalence are found to have lower school enrolment (B: −0.202, sig p < 0.01) and higher school absenteeism (B: 2.334, sig p < 0.001). Districts where more households have access to private water facilities have higher school enrolment (B: 0.025, sig p < 0.01) and lower school absenteeism (B: −0.027, sig p < 0.01). More use of piped and bottled water in a district is associated with a lower diarrhoea prevalence (B: −0.004, sig p < 0.05). Policy-makers should take the benefits of improved water supply into account when making cost–benefit analyses regarding investments in water infrastructure.