When a hack for peeling hard-cooked eggs went viral this week, we did our homework. It went down like this: Twitter user Back to Nature posted a video showing how to almost effortlessly peel an egg using just a glass of water. Place a hard-cooked egg in the glass, shake vigorously and the shell slides right off.

The internet couldn’t decide: Was this brilliant or bust? Some people swore their cups runneth over (with perfectly peeled eggs). Others said the trick wasn’t all it was cracked up to be.

So we put the hack to test. We shook eggs that were boiled. We shook eggs that were steamed. We shook them in rocks glasses and highballs and coffee mugs. We did a heck of a lot of shaking.

Internet, we figured out how to make it work well... about 60 percent of the time. If you like those odds, here’s what to do:

Use a coffee mug or rocks glass. (The lid to a quart container or any round, flat surface can help prevent splashing.)

Steam your eggs, don’t boil them.

Shake them while warm.

Settle for success a little more than half of the time.

How to Peel a Hard-Cooked Egg in a Cup

We found that short, squat cups such as a coffee mug or rocks glass work best. We also found that the cooking and cooling methods matter.

Steaming (already our preferred method for cooking eggs—more on that below) made for eggs that were noticeably easier to peel than boiled eggs. The shells on steamed eggs slipped right off in the cup, while the shells on boiled eggs merely cracked (same as if you’d stayed dry and just rolled them on the counter).

The real shock was that shocking didn’t help. Until now, our favored method of peeling was shocking hard-cooked eggs for 5 minutes in an ice bath immediately after cooking. The cold water causes the hot shell to pull away from the membrane between the shell and the cooked egg white, making the eggs easier to peel. Warm eggs are prone to pitting when peeled. Eggs chilled slowly in the refrigerator don’t cool quickly enough and residual heat turns the whites chalky. Eggs shocked in cold water right away provided the quickest, cleanest peel for us.

Until now.

This new egg-in-cup method only worked for us with warm eggs straight from the pan. It never worked with shocked eggs.

Our friend J. Kenji Lopez-Alt, who recently did his own test for achieving the perfect hard-cooked egg in the New York Times, would be happy. While Lopez-Alt stands behind steaming over boiling like we do (starting—crucially—while the water is hot), he does not suggest shocking eggs in an ice bath. He finds the ice bath makes eggs slightly harder to peel—a result that surprised him after previous tests and one that differs from our own tests. Using this new peeling method, we’ll join Lopez-Alt and put the ice bath aside. Steaming, however, stays.

Why Steamed Eggs Are Better Than Boiled

Regardless of how you peel, always start with steamed eggs. We’ve tested boiled versus steamed eggs, incorporating cooking time and cooling methods into our tests. Our tests confirmed that steaming is superior to boiling.

Why? Steam has more energy than water because its molecules move faster. That energy is transferred to the eggs as the steam condenses on the eggs. But because there are far fewer molecules of water in steam than in liquid, the energy in steam is transferred with less intensity, producing more tender whites and creamier yolks. Steaming also overcomes the cooling effect of the boiling method. Sounds odd, but it’s true. Adding eggs to boiling cools the water. The more eggs you add, the longer it takes for them to cook. But with steam, the number of eggs has no bearing on the temperature and won’t affect cooking time.

Our Recommendation

For perfect hard-cooked eggs, steam for 12 minutes, adding the eggs only once the water is boiling, then shake vigorously in a cup while still warm (or resist the viral trend and shock them in ice water).

Fill a large saucepan with 1 inch of water. Place a folding steamer basket in the pan, cover and bring to a boil over medium-high. When the water is boiling, add large eggs to the steamer basket, cover and cook for 12 minutes. If you’re looking for a peeling method that’s not as splashy as this latest trick, use an ice bath. Fill a medium bowl with ice and water. Immediately transfer the eggs to the ice bath and let stand 5 minutes until the eggs have cooled. Or, fill a mug half way with water and shake right away in the cup.