Of all the peoples of the world, the Chinese are probably the most at home with their excrement. They know its value. For 4,000 years they have used raw human feces to fertilize fields. China’s use of “night soil,” as the Chinese rightly call a manure that is collected after dark, is probably the reason that its soils are still healthy after four millennia of intensive agriculture, while other great civilizations—the Maya, for one—floundered when their soils turned to dust.

Sanitation professionals sometimes divide the world into fecal-phobic and fecal-philiac cultures. India is the former (though only when the dung is not from cows); China is definitely and blithely the latter. Nor is the place of excrement confined to the fields. It has featured prominently in Chinese public life and literature for at least a thousand years.

In the Communist era, excrement took on political importance, because Party policy decided excrement was essential for the Great Agricultural Leap Forward. Andrew Morris, a historian at California Polytechnic, relates the story of night-soil carrier Shi Chuanxiang, who in 1959 was a star speaker at the Communist Party’s National Conference of Heroes. Shi Chuanxiang worked for the exploitative gangs who controlled Beijing’s night-soil collection. Customers showed their appreciation for his work by calling him “Mr. Shitman” or “Stinky Shit Egg.”

These days, this national interest takes the form of serious investment into an unusual alternative fuel. Along with all the other stunning statistics China can provide, it can also claim to be the world leader in making energy from human excrement.

Biogas, as this energy is known, can be produced from the fermentation of any organic material, from wood to vegetables to human excreta. In an oxygen-free digester, which acts somewhat like a human stomach, micro-organisms break down the material into sugar and acids, which then become gas. Mostly methane, with carbon dioxide and a little hydrogen sulfide, biogas can be used as fuel for cooking hobs, lights, and, sometimes, showers. It can also be converted into electricity. The slurry that remains from the digestion process is good fertilizer and considerably safer than raw excrement.

At last count, if official figures are reliable, 15.4 million rural households in China are connecting their toilets to a biogas digester, switching on their stoves a few hours later and cooking with the proceeds. India has installed several million digesters, though they run on cow dung, and there are only so many cows. China has a billion humans, and that means a billion suppliers of a cheap and inexhaustible supply of clean energy.

Perched on a bed in her office in Xi’an, Wang Ming Ying explains why she was convinced enough by biogas to change her life. A tiny woman fizzing with energy, she now runs the Shaanxi Mothers environmental association. For her, it began with the trees. As an official in a government propaganda office, she was sent to the UN women’s conference in Beijing in 1995, and it changed her life. “I saw,” she tells me, “how the poverty of women is directly related to the deterioration of the environment.” Poor rural women try to clear more land for crops by cutting down forests. This brought on soil erosion, so more forest was cleared for new crop land. It was a vicious cycle that no one knew how to escape.

Wang Ming Ying set off to northern Shaanxi province “to see what was going on.” She found hillsides empty of trees and farmers devoid of hope. “I thought that if a woman has education or not, we can do environmental protection together.” She decided to form an organisation of women. Mothers, actually. “Mothers are key: they can influence the family.”

The group’s name was surprisingly controversial. “The government didn’t like the word ‘volunteers.’ ” Voluntary activity was a problematic concept in China then. Public service was always imposed from above. The state controlled everything, and that included excreting habits and public hygiene. Throughout the 1950s, for example, the Chinese government tried several times to eradicate a plague of schistosomiasis, an infection of a parasitic worm found in dirty rice-paddy water. (It’s also known as bilharzia or, in Chinese, “blood-sucking worm disease.”) Shepherd boys, according to a report, “were mobilized to pick up stray excreta.”

But Wang Ming Ying persisted and, after a few years of environmental work—there was a lot of litter-collection—Shaanxi Mothers were shown a video of biogas technology. They liked it, and decided to try it out with two test families in northern Shaanxi. The families lived in a village that had a fate typical of the area. Thirty years earlier, its population had consisted of four families, and the village was surrounded by trees. By the time Shaanxi Mothers arrived, there were thirty-four families and the forest was almost gone.

Biogas was an ideal solution. Two families were chosen to try out the digesters. The technique was simple enough: add pig excrement and human waste to the digester, occasionally stir it, and tap off the energy. But when the Mothers arrived for a follow-up survey, neither digester was being used. Eventually, Wang Ming Ying discovered that one of the families’ toddler sons, Peng, had died by drowning in the pit. The Shaanxi Mothers learned a lesson: you can’t install technology (the hardware) without ensuring the human element (the software) is also operational. Follow-up is essential. They began talking to their biogas users, a lot. It worked.

Ten years on, Shaanxi Mothers have installed 1,294 digesters in 26 villages. They have won prizes and got funding, though never enough. The money goes to subsidizing a third of the cost of a digester, with the householder and the government making up the rest. Wang Ming Ying estimates that for every new biogas digester installed, 1.2 tons of firewood—three trees—will be spared. She tells me to go and see for myself.

The journey to Da Li is long. It goes along roads that are so new they’re not on the map and roads so bad they are flattened rocks with aspirations to being a thoroughfare. After several hours of bone-rattling driving, we arrive in northwest Shaanxi Province. There are boxes of apples everywhere, being loaded onto trucks, stacked on street corners. This is apple country. What the buyers of apples probably don’t know is that this is apples-fertilized-with-human-excreta country.

Wang Ming Ying is a hero here, and all due courtesy is being extended. A blackboard bears the phrase “We wholeheartedly welcome the advice and arrival of our superior leaders,” and bowls of apples and grapes have been thoughtfully set out on the table. They have been fertilized with biogas slurry, the village leader tells me with pride. Look, he says, how juicy the apples are. They are better now that we use biogas. The skin is thinner and the juice is sweeter. Even rice is better. Rice cooked with biogas is chewier and less likely to stick.

One of my hosts says there have been three main changes. “Human and national excreta is now turned into treasure. Households are much cleaner. Neighbors have a better relationship.” Also, farmers’ incomes have increased. Annually, they save 1,400 yuan ($200) on fertilizer, fuel, and the medicines they would otherwise have to buy for the constant diarrhea and stomach illnesses caused by filthy latrines. Also, farmers save two canisters of cooking gas per year, worth 120 yuan ($20). Using biogas for lighting saves another 40 yuan ($5) on energy bills. All in all, she says, the village has increased its income by 300,000 yuan ($43,000) a year. “The village,” she concludes firmly, “is happier and wealthier.”

Before biogas, most villagers had used a hole in the backyard as a latrine. In Da Li, as in countless other villages, things began to change when the city came back to the country. Youngsters who had gone to the city got used to different standards. “They were coming home and complaining about the mao kun,” says Zhou. “They didn’t want to use it anymore.” They demanded better facilities for their visits home, making fertile ground for the Shaanxi Mothers to make their biogas case. The women of Da Li proved to be powerful allies. The reason why becomes obvious when Zhou leads me to his house and into the kitchen, past the cartful of apples in the driveway. Here, his wife gives me a demonstration of how she used to live and breathe. She kneels in front of her cast-iron oven, pretending to feed it with kindling and rice stalks, and mimes how she used to cough and how her eyes would water. The ovens are still used to bake bread, but otherwise the two-ring biogas burner is enough for three meals a day in summer and two in winter.

Biogas is not perfect. As the tragedy of Peng showed, digesters can fail because of mechanics and human error. Also, there is little agreement on how safe the slurry actually is. Opinions vary as to whether a four-week digestion process, for example, kills all pathogens. Ascaris eggs, which grow into long and revolting worms, are exceptionally hardy. (They are also still unvanquished, though humanity has been dealing with them forever: ascaris have been detected in fossilized Peruvian dung dating from 2277 B.C.) Swedish academic Mathias Gustavsson, a fan of biogas—he refers to it as a “solution in search of its problem”—writes that “there is no such thing as a total removal of all parasites due to an anaerobic process.”

But a biogas digester has to be better than a bucket. And it has enormous potential: In the French city of Lille, ten city buses now run on biogas taken from the city’s sewage works, and city officials claim the biogas buses are carbon neutral and less polluting (biogas gives off fewer particles).

In Da Li, they’re not bothered about buses. In a courtyard behind a carved wooden door, a woman sits weaving as if she’s been doing it for centuries. In fact, she only got the loom a year ago. A gas made from something we all flush away without thought has given her cheaper bills, a cleaner environment, and something she’s never had before, called free time.