What’s the best way to crack an egg? Physics has the answer.

Learning to crack an egg is a culinary rite of passage. Do it correctly, and the shell swiftly breaks, spilling the liquid contents out in one fell swoop. Do it wrong, and you end up with yolk on your hands and shell in your bowl. Luckily, science has hatched a formula that is nearly infallible. All it requires is knowledge of a few basic physics principles.

To complete the perfect crack, you need to know where and with what force. “You want to initiate a crack at the flattest part of the egg, which is the middle,” says Volker Blum, a materials scientist at Duke University.

Like all objects, eggshells have breaking points, or limits beyond which they cannot absorb more force. That limit is lowest where the egg is weakest—its center. That’s precisely because the center area is the flattest, says Sinan Keten, a mechanical engineer at Northwestern University. Contrastingly, the top and bottom of an egg are the strongest—and therefore hardest to crack—because they have the most curvature. Think of a structure that is rounded as opposed to flat, like an arched doorway or an arched bridge. The arch is able to hold a heavier load without breaking because it distributes that weight more evenly. This is true for an egg, too. In fact, if you hold an egg between two fingers at each pole and squeeze as hard as you can, it’s extremely unlikely you’ll be able to apply enough force to crack it. That’s because the shell’s curves evenly distribute the pressure you’re applying.

Now that you’ve found the cracking sweet spot, you need to make a swift initial crack that results in a fracture that’s just large enough for your thumbs to fit through. The rest is all about effort.

According to fracture mechanics, once you’ve created a crack in an object, that fissure will expand only slightly until you’ve applied the amount of force needed for the break to reach something called its critical crack length. Once achieved, the rift will grow rapidly as long as that force remains steady. If you’ve ever walked across a frozen pond of thin ice and watched a crack form beneath your feet, it’s the same basic idea. Soon after the critical crack length is reached, you fall through the ice. To successfully open an egg after cracking it, you have to apply the force necessary to the cracked edges for them to start and continue expanding. Be careful not to overdo it, though. Pulling the shell edges away from each other too harshly can result in shell destruction.

Ultimately, a clean, fast break across the egg-quator and some even-handed prying will save you a scrambled mess.