Scientists have cracked the code for building the tallest possible sandcastle: Use very little water.

Research has shown that water holds sand together by forming "liquid bridges" between the contact points of the grains. But too much or too little water will make the castle crumble.

So exactly how much water do you need to make a perfect sandcastle? Traditional estimates put the ratio at one pail of water for every eight pails of sand (or 12.5 percent water). But new research revises the amount of liquid down to just 1 percent.

That optimal mixture will allow your castle to reach a maximum height that equals roughly the radius of the base to the power of two-thirds, the researchers say. That equation means it is possible to build tall, skinny columns of sand that won't fall apart.

"Using typical values for beach sand, a cylinder with a radius of 8 inches (20 centimeters) for instance could be as tall as about 8 feet (2.4 meters), which is in quite good agreement with what can be observed for real sandcastles," the researchers wrote in a paper published in the journal Nature Scientific Reports.

Ed Jarrett, the Guinness World Record holder for the tallest sandcastle, might want to take note. He won the honor in Connecticut last summer with a castle nearly 38-feet (nearly 12 m) tall built atop a relatively wide base.