There's vast variation in the percentage of households with books available for kids when you look across a sampling of low- and middle-income countries.

Michaeleen Doucleff/NPR with data from UNICEF

The world is in the midst of a porcelain revolution.

Nearly 2 billion people have gained access to clean toilets, or at least a decent outhouse, since 1990, the nonprofit UNICEF reports Thursday.

That rise in sanitation has led to big health improvements, the agency says, because contaminated drinking water is still a major cause of disease and death for children.

But toilets aren't only the reason the world is becoming a better place for kids. Children around the globe today have more access to education, medicine and food than they did two decades ago, UNICEF finds.

The agency examined a slew of data from developing countries, including literacy rates in youths, percentage of households with books, toys or adequate child care and the prevalence of child labor and marriage.

The numbers show slow, steady progress in many areas. More kids are going to school, and fewer are dying of preventable diseases.

"The great news is that child mortality has fallen over the last couple of decades," says UNICEF's Holly Newby, a statistician who worked on the report.

"We had 12.6 million kids [under age 5] die in 1990 compared to 6.6 million in 2012," she tells Shots. "So although each of these deaths is a tragedy, we are making progress on child mortality."

Nevertheless, there are still huge difference between the lives of kids in rich countries and those in the poorest places. A third of babies born in Pakistan between 2008 and 2012 were underweight compared with just 8 percent of those born in the U.S.

Only 1 percent of kids in the Central African Republic have books in their homes while 97 percent of young Ukrainians do.

Although children in many African countries still don't get immunized against preventable diseases at nearly the same rate as those in Europe or North America, vaccination rates even in the poorest regions of the planet are improving.

Despite the progress, Newby says there's a lot more work to be done. "Children in the poorest countries in the world are still dying from diarrhea," she says. "This is dehydration basically. I'm not worried about my daughter in New York City dying of dehydration from diarrhea. It's a tragedy that for the want of simply oral rehydration salts ... they're dying."

The progress at the national level, which the study focuses on, often hides problems in the poorest neighborhoods or regions of particular countries, Newby says.

For instance, India is booming economically. It reported a 5 percent increase in annual per capita gross national product between 1990 and 2012. But big gains in wealth among the upper and middle class can mask the lack of progress made among the rural poor.

Or, take sanitation Southeast Asia. The region appears to be making great strides against open defecation. "But the poorest 40 percent of the population in southern Asia have barely benefited from improvements in sanitation over the last couple of decades," Newby says. "This is a critically important point that we really need to grapple with. How do we get access to toilets to the poorest?"