When kept for too long or exposed to warm temperatures, hard-boiled eggs can become spoiled. Hard-boiled eggs also can attract harmful bacteria which cause infections when ingested. It's important to learn food safety tips for hard-boiled eggs, especially during Easter and Passover, when they are often left out for long periods of time.
Raw eggs have a shelf life of around one month when they are kept refrigerated, thanks to a harmless mineral oil that egg producers use to give eggs a protective coat. But this coating comes off during the boiling process used to hard-boil eggs. Without this coating, the eggs have a much shorter shelf life. Don't expect a hard-boiled egg to last for more than a week in the refrigerator before spoiling. If the eggs are outside the refrigerator, they will go bad in two hours. Pay careful attention to this if you have eggs out for Easter or Passover.
The main sign to look for in spoiled eggs (regardless of whether they are raw or hard-boiled) is the rotten egg smell of sulfur. You may not notice the smell while the shell remains on the egg, but it will be clear when the shell is removed. Sometimes hard-boiled eggs have a green color in parts of the yolk. This coloring occurs during cooking and does not mean the egg has spoiled. Eggs with green coloring are still fine to eat.
Harmful bacteria can enter hard-boiled eggs kept outside the refrigerator. The easiest way for the bacteria to enter an egg is through a crack. If you find a cracked hard-boiled egg that has been sitting outside the refrigerator, you should just throw it away. Don't examine the egg to see if any harm has come to it, because you won't be able to visually confirm whether bacteria has entered the egg.
Because boiling eggs washes off the protective mineral oil coating, the pores in the egg are exposed. Some bacteria are small enough to enter through these pores. This will be more likely to happen in areas with greater amounts of bacteria. For example, if you have an egg sitting out on a clean table for an hour, bacteria probably won't infect it. But you should take care if using hard-boiled eggs for an Easter egg hunt. Don't place eggs directly in dirt; put them in a basket to provide some protection. An even better option is to use plastic eggs with candy inside rather than hard-boiled eggs.