While some countries are improving, too many students are still in danger of health problems and missing out on education.
A lack of proper school toilets threatens the health, education and safety of at least 620 million children around the world, the charity WaterAid said in a new study today.
Children at one in three schools lack access to proper toilets, putting them at risk of diarrhoea and other infections and forcing some to miss lessons altogether.
Guinea-Bissau in West Africa has the worst school toilets while Ethiopian children fare worst at home - with 93% of homes lacking a decent toilet. The study, based on data from 101 countries, was released ahead of World Toilet Day on November 19.
"The message here is that water and sanitation affect everything," WaterAid spokeswoman Anna France-Williams told the Thomson Reuters Foundation.
Lack of safe water is a problem too
A report by the World Health Organization in August said nearly half the world's schools lack either clean drinking water, toilets or handwashing facilities. It found nearly a third of primary and secondary schools don't have a safe and reliable drinking water supply. Nearly 20% of schools had no safe drinking water at all.
"If there's no toilet in schools, children will miss lessons and it will have an impact on their growing up."
A lack of proper sanitation puts millions of children around the world in danger of diarrhoea, which kills 289,000 under-fives a year, WaterAid said.
But some regions have started to clean up their act - notably South Asia, where access to toilets in schools has improved.
More than half the schools in Bangladesh now have access to decent toilets, while students in 73% of schools in India and 76% of those in Bhutan can access basic sanitation.
Akramul Islam, director of water, sanitation and hygiene at the Bangladeshi charity BRAC, said the country's once-high levels of open defecation - using open ground rather than toilets - were now below 1%.
"Today, schools have separate toilets for girls and boys and the issue of menstrual hygiene is also being addressed," he said.
"This has happened because of initiatives taken by both the government, the NGOs and other stakeholders."
Despite the improvements, more than a third of girls in South Asia miss school on between one to three days a month during their period, WaterAid said, urging greater investment in basic sanitation.
"If we are serious about all children and young people, wherever they are, whatever their gender, physical ability or community background, having their right to clean water and sanitation, we must take decisive and inclusive action now," said Chief Executive Tim Wainwright.