The following essay is reprinted with permission from The Conversation, an online publication covering the latest research.

Whether we prefer water sports or relaxing with a good book, the humble sandcastle is often a seaside must. But what’s the secret to building a majestic sandcastle that will withstand the tide of time? Luckily, there’s a scientific formula for that.

It all started back in 2004, when a holiday company asked us to investigate the question. As a sedimentologist, someone who studies fragments of rock, I began pondering what kind of beach would work best for castle building. To find out, I compared the sand from the ten most popular beaches in the UK at the time. Though in truth any sandy beach will do, Torquay came out top with its delightful red sand, closely followed by Bridlington, with Bournemouth, Great Yarmouth and Tenby tied in third. At the bottom of the league was Rhyl.

Having selected a beach one has to find the perfect spot. Now this is a question of taste rather than hard rules. Some might prefer a spot close to the car park with easy access when the rain arrives while others might want to stay next to a cafe. Others yet might hanker after the secluded fringes of the beach, perhaps sheltered by natural promontories of rock that keep the biting wind at bay.

Now a castle should be a symbol of military strength, but to stand proud one needs strong sand. The strength of sand depends on the properties of its individual grains and on the water between them. The more angular the grains, the better they will lock together. The more a grain is transported the more rounded it becomes. Microscopic shell fragments work well in this regard. The finer the grains the more they hold the water. And water matters.

Too much water and your sand will flow, too little and it will crumble. You need to get it just right and your castle will stand proud and last. It’s all down to the surface tension of water – the thing that gives the “meniscus”, or skin, to a glass of water and holds down that glass when placed on a wet bar top. The film of water between individual sand grains is what gives sand its strength, too much and it lubricates one grain over the other, but just right and it binds them strong.

The magic formula

Now the experimentation we did suggested that the perfect sandcastle requires one bucket of water to eight buckets of dry sand. Or if you want the magic formula: Water = 0.125 x Sand. So assuming that you don’t have any science gear with you, then you are looking for a spot close to the high tide line – usually marked by a line of seaweed and flotsam – and the low tide line where sand is still visibly wet and the waves are close. But remember that this will change as the tide comes and goes during the day.

My next tip refers to quality of your tools. In my experience there is a direct correlation between the age of the builder, spade size and the speed at which boredom sets in. Adult helpers find the smallest spade nothing but frustrating, and while young assistants might aspire to use the biggest spade, it is often too big to handle. A selection of tools will keep the workforce in harmony. The bucket also has to be the perfect size and shape. The best buckets are the simple round ones – not the ones with the fancy turrets which when turned out produce a castle in itself. A round bucket will allow you turn out countless towers and architectural features. A single bucket can be turned out several times to create a large mound from which you carve an amazing tower.

As you build, spare a thought to the story, not just of the castle one is building with its tales of derring-do, but also the story of the sand itself. Each grain is a fragment of rock and contains a story of relict mountains, ancient rivers, dinosaur-infested swamps and seas, of past climates and events which tell the amazing story of our planet. The red sand of Torquay once blew in giant sandstorms, as the area was once part of a desert far greater than that of the Sahara. The sand at Bridlington or Great Yarmouth tells a tale of giant ice sheets and drowned lands below the North Sea.

My next tip refers to size. Yes, size matters – at least in the game of sandcastles. The modest castle with perfect towers, battlements and moat is ok, but it is the huge castles which break the beach horizon that inspire awe and wonderment in people that pass by. Think big! Pebbles, shells, driftwood fragments and feathers all enhance a castle. And let’s face it: a castle is about being seen. And although there may be science behind the humble sandcastle, don’t forget to have fun building it.

This article was originally published on The Conversation. Read the original article.