Tips for how long to hard-boil eggs for soft, medium and hard yolks, so you have a perfect hard-boiled egg every time.

Hilary Meyer

Hard-boiled eggs seem simple, but they're one of the hardest things to cook-or to cook right, anyway. I know it sounds hard to believe, but they're ridiculously easy to screw up.

Think about the last hard-boiled egg you had. Chances are it wasn't perfect. Maybe it had a rubbery texture. Maybe the yolk was a little green around the edges or the egg white was filled with pockmarks from the shell sticking to the surface of the white when it was peeled. Maybe it broke open while it was cooking. Maybe it smelled like sulfur. You probably ate it anyway-it's not the end of the world-but a perfectly cooked hard-boiled egg is a treat. How do you avoid these pitfalls and end up with the perfect hard-boiled egg? Here's how to boil eggs perfectly.

Related: Our Best Deviled Egg Recipes

How to Cook Hard-Boiled Eggs

Pictured Recipe: Easy Morning Brunch Bowl

For hard-cooked eggs, place cold large eggs in a single layer in a saucepan; cover with water. Set the pan over medium-high heat. When the water just begins to bubble vigorously, reduce the heat to achieve the barest simmer; simmer for 10 minutes. Remove from the heat, pour out the hot water and cover the eggs with ice-cold water. Let the eggs stand until cool enough to handle before peeling. This should give you a nice, firm yolk.

How to Cook Medium-Boiled Eggs

For a yolk that's softer (but not runny), follow the process above but simmer for only 6 minutes.

How to Cook Soft-Boiled Eggs

Pictured Recipe: Soft-Boiled Eggs & Soldiers

Want a firm white, but a runny yolk? Again, follow the process above, but simmer for just 4 minutes. A softer yolk is a little less forgiving than a harder one, so be sure to cool your eggs down right away to halt the cooking.

Related: 3 Steps to Perfectly Dippable Soft-Boiled Eggs

3 Tips to Make Perfect Hard-Boiled Eggs Every Time

1. Don't Actually Boil Your Eggs

Pictured Recipe: Chicken Ramen with Bok Choy & Soy Eggs

"Hard-boiled egg" is a misnomer-you should never actually boil an egg at all, for two reasons. One, the boiling action of the water tosses eggs around the pan, causing them to crash into each other and possibly split open. If they crack open right away, the white seeps out of the shell and that spells disaster.

The second reason is that the protein in the egg whites firms up, or coagulates, at a much lower temperature than you might expect-around 140-190°F (water boils at 212°F.) Although the yolks may be cooked perfectly, if the whites have spent too much time in high heat they'll turn rubbery. Start your eggs in cold water and bring them up to a gentle simmer (180-190°F) to avoid these issues.

2. Don't Cook Your Eggs Too Long

Pictured Recipe: Asparagus Salad with Eggs & Jambon de Bayonne

Plenty of people just let their eggs cook to oblivion to ensure the yolk is hard. Let them go too long and you may end up with an unpleasant (but harmless) sulfur smell and a green ring around the yolk. Both of these are harmless reactions to overcooking, but can easily be avoided. Ten minutes is really all you need for a light-textured white and a fully cooked yolk (less time if you want a softer yolk). And just because your eggs are out of the hot water doesn't mean they're done cooking. Eggs continue cooking if you don't cool them down properly in ice-cold water when the cooking time is up.

Pictured Recipe: Soy Sauce Eggs

3. How to Peel a Hard-Boiled Egg the Right Way

Pictured Recipe: Spicy Ramen Cup of Noodles

When it comes to what you're eating, fresh is almost always best, but this may not be the case when you're making hard-boiled eggs. It's a fact that older eggs are easier to peel. If you keep your eggs in the refrigerator for several days before you cook them, the pH will increase slightly, making the white less prone to sticking stubbornly to the inner shell. If you don't have time to wait, cracking the shell very slightly before you cook the egg may help. The trick here is crack the shell, but not the membrane inside. Tap a pin gently into the wider end of the egg (it should just go in a millimeter or two) and cook it normally. And finally, although there is no scientific proof, some people swear (myself included) that just-cooked eggs (still warm, but not hot enough to burn your fingers) are easier to peel than eggs that have been cooled and stored in the fridge.