Anemia impairs physical and cognitive development in children and reduces human capital accumulation. The prior economics literature has focused on the role of inadequate nutrition in causing anemia. This paper is the first to show that sanitation, a public good, significantly contributes to preventing anemia. We identify effects by exploiting rapid and differential improvement in sanitation across regions of Nepal between 2006 and 2011. Within regions over time, cohorts of children exposed to better community sanitation developed higher hemoglobin levels. Our results highlight a previously undocumented externality of open defecation, which is today practiced by over a billion people worldwide.