Schools nationwide, government or private, have been ordered by the Supreme Court to provide toilets, drinking water and other basic infrastructure within six months, calling it part of children's right to education.
The court said in the judgement seen by AFP on Saturday that research showed wherever toilet facilities are inadequate, parents are reluctant to send their children to school -- especially if they are girls.
Lack of toilets and drinking water "clearly violate the right to free and compulsory education of children," the court said in the judgement handed down earlier in the week.
The court stated children need to "study in a clean and healthy environment" and said its ruling applied to state and privately run schools.
State governments must provide "toilet facilities for boys and girls, drinking water facilities, sufficient classrooms, appointment of teaching and non-teaching staff etc., if not already provided, within six months".
The top court was acting on a petition filed in 2004 by a charity organization but still not implemented despite several rulings.
An activist group, Right to Education Forum, reported in April that one in 10 Indian schools lack proper drinking water facilities while 40 percent do not have toilets.
In 2010, India launched a landmark education program obliging all states in the world's second most populous nation to provide free schooling for every child between the age of six and 14 but child labor remains common.
Critics of India's ramshackle education system also say the nation's schools suffer from poor infrastructure and rampant teacher absenteeism, raising fears of tens of millions of badly educated young people unable to find jobs.
The problem of lack of basic sanitation is also widespread in Indian homes with census data showing more households in the country of 1.2 billion people have a telephone than a toilet.
Some 47 percent of India's 330 million households have toilet facilities while 63 percent of homes have phone connections -- mostly mobiles -- showing how the nation's rapid communication revolution has spread through society.