You should want to drink from your toilet. Flushes flood sewers with precious liquid that ends up washed out to sea or sprinkled on crops. But we could be enjoying recycled urine as a beverage. Some US cities, like the perpetually parched San Diego, are beginning to use advanced purification treatment plants to reclaim the stuff, combating drought by harnessing millions of gallons of would-be waste daily. It tastes so good, you’ll forget that it used to be your neighbor’s pee.

Step 1: out with the old

A person sitting on a toilet in a bathroom with a full sink and clawfoot bathtub, drinking water while they sit. Blue pipes show the direction of the water when it leaves the bathroom. Illustration.
Illustration by Adam Simpson

Your urine is more than 90 percent water (and your poop is about three-quarters). Each time you flush, the sewer system ferries your waste—along with 1.6 to 7 gallons of perfectly good H2O used to swirl it down your porcelain throne—to a treatment plant designed to make it taste delicious.

Step 2: catching the big stuff

A blue wastewater pipe leading into a series of three containers, each of which separates out gradually smaller pieces of debris. Illustration.
Illustration by Adam Simpson

Treatment plants employ a series of mesh screens to catch rocks, sticks, and other—ahem—larger refuse floating in your former toilet juice. Finer debris sinks down to the bottom of deep pools, while the top layer flows through. Some municipalities also add chemicals that clump crud together, which makes it easier to catch and remove stowaway stools.

Step 3: taking a closer look

A blue wastewater pipe leading into a large storage tank with a propeller at the bottom that mixes up the sewage. Illustration.
Illustration by Adam Simpson

“Activated sludge” sounds nasty, but this mushy mix of bacteria actually helps break down organic contaminants. A good stir swirls and sloshes the sludge through giant vats. When it settles, it leaves behind purified liquid that can then be disinfected for use in irrigation or other industrial applications. But you wouldn’t want to drink the stuff (at least not yet).

Step 4: one last pass

A blue wastewater pipe passing through a cluster of strawlike fibers. Illustration.
Illustration by Adam Simpson

After another round of filtration for good measure, the good stuff makes its way through strawlike fibers. Pressure forces H2O through pores so small that only individual molecules can fit, ensuring that only a pure hydrogen-oxygen cocktail crosses over the membrane. This process, called reverse osmosis, makes former toilet contents pristine and drinkable.

Step 5: back to nature

A blue wastewater pipe going into a natural body of water near some forested mountains, while rain falls into the water, and another blue water pipe leaving the reservoir. Illustration.
Illustration by Adam Simpson

People don’t like the idea of drinking recycled pee, so the now-pristine liquid goes back into natural reservoirs to mix with droplets from rain and rivers. It can stay there indefinitely, gathering minerals from rocks and soil, and going through natural filtration processes until it’s called back into action.

Step 6: homeward bound

A blue water pipe entering a water filtration plant, and another blue water pipe exiting. Illustration.
Illustration by Adam Simpson

After sitting pretty in the reservoir for who knows how long, all that agua needs another round of filtration before it’s safe to drink again. Then a disinfectant like chlorine kills microbes. The result whooshes out through your tap, into a glass, and down your gullet—and so the cycle begins anew.

This story has been updated. It was originally published in the March/April 2017 issue of Popular Science, under the title “The Water (Re)Cycle.”