We have some bad news. Those amazing white sandy beaches in Hawaii and similar places are not just finely milled pieces of rock.

Instead, that beautiful sand is at least partially made up of fish poop. Lots and lots of fish poop.

The species responsible are parrotfish - large and colourful tropical fish that live in coral reefs and near rocky coasts around the world. They have exceptionally strong teeth, and love to eat algae.

Fleshy algae is actually a big issue for corals, as it can remove light and encourage disease-causing microorganism growth. So parrotfish are doing coral reefs a great service by cleaning up - although some of them also gobble up coral itself.

Two types of these colourful fish are called scrapers or 'excavators' (basically chompers), when it comes to eating algae on coral. 

The excavators do most of the sand-pooping, having fed on up to 20 bites a minute of crunchy coral, algae, and even the protein-rich bacteria and other microbes inside the coral itself.

A parrotfishLook at that toothy smile! (burnsboxco/iStock)

All this gets mashed up, and comes out the other end as pure, beautiful calcium carbonate sand.

Marine biologist Ling Ong, from Hawaii's SWCA Environmental Consultants says that a large Hawaiian parrotfish can poop out up to 800 pounds (362 kilograms) of sand a year.

"In places like Hawaii, where we have very little terrestrial input of sand, almost all of our sand is of biological origin," Ong said in a 2014 Wired interview.

"So I like to tell people that the sand you're standing on in Hawaii has probably gone through the gut of something. It'll have gone through the gut of a parrotfish, a sea urchin, some kind of worm."

Luckily, not all beaches are quite so… digested. Most of the sand around the world comes from mechanical forces, not biomechanical ones.

"Sand comes from many locations, sources, and environments. Sand forms when rocks break down from weathering and eroding over thousands and even millions of years. Rocks take time to decompose, especially quartz (silica) and feldspar," explains the National Oceanic and Atmospheric Administration.

"Often starting thousands of miles from the ocean, rocks slowly travel down rivers and streams, constantly breaking down along the way. Once they make it to the ocean, they further erode from the constant action of waves and tides."

But amongst all the fascinating journeys of sand, the digestive system of a fish has to be the most interesting. Next time you're snorkelling with parrotfish, make sure to thank them for those lovely Hawaiian beaches.