Hard-boiled eggs last about a week if they are kept in their shells, and should be refrigerated within two hours of cooking, says the USDA Food Safety and Inspection Service. If they are peeled and then stored, they will stay fresh for a shorter time.

Hard-boiled eggs are more susceptible to spoilage than fresh eggs because the cooking process removes a naturally occurring waxy protective layer called the cuticle from their shells. The cuticle coats freshly laid eggs, and much of it is washed off when the eggs are graded and packed. When the eggs are boiled, the water removes the rest. This leaves open pores in the shells for bacteria to enter and contaminate the eggs more easily.

The FSIS also has some urgent warnings for Easter egg hunters: Do not eat cracked hard-boiled eggs! Do not let your hunt exceed two hours! And refrigerate your found eggs and eat them within seven days!

Rubbery whites, dry yolks turning gray around the outside: Poorly cooked hard-boiled eggs are a sad, sad thing. This easy recipe (hint: you need a timer) turns out perfect results every time. All you need is a little determination and a lot of vigilance. Get the Perfect Hard-Boiled Egg recipe. (Of course, there’s always the Instant Pot.)