Early-life health shapes cognitive skills and human capital. In India, widespread open defecation without using a toilet is an important source of childhood disease. We study the effects on childhood cognitive achievement of early-life exposure to India’s Total Sanitation Campaign (TSC), a large government program that encouraged local governments to build latrines and promote their use. We find that the TSC caused six-year-olds exposed to it in their first year of life to be more likely to recognize letters and simple numbers. Our results suggest that open defecation is an important threat to human capital in India.