Have you ever noticed a greenish-grayish tinge around the yolk of a hard-boiled egg? If you have only ever eaten soft-boiled eggs, probably not. But if you are prone to boiling eggs, getting distracted, remembering the eggs, and rushing back to turn the stove off — don’t worry, we’ve all been there — you’ve probably found some green-yolked eggs before. The real question is: Are these eggs safe to eat?
What Causes the Green Tinge Around a Hard-Boiled Egg?
The green tinge can be caused by two things. Here’s the first: When you leave eggs boiling for too long, the hydrogen in the egg white is mixed with the sulfur in the yolk. This causes a chemical reaction that forms ferrous sulfide over the yolk. Alternatively, the green ring can come from a high amount of iron in the boiling water. Fortunately, hard-boiled eggs with a green yolk are safe to eat, although they may not look so pretty and are a little firmer than your liking. 
To avoid this ring, avoid overcooking the eggs and cool them quickly under running water or in a bowl of ice water. Then, store them in their shells in the refrigerator.
Read: Should we eat eggs with the blood spot?
Here is Chef Jo Lusted’s foolproof method for hard-boiled eggs:
- Place eggs into a pot in a single layer. Stacking them will cause uneven cooking, so use a bigger pot if needed.
- Cover the layer of eggs with cold water that’s at least one inch full.
- Bring the water to a gentle boil over high heat.
- As soon as the water begins to bubble, remove the pot from the heat and turn off the burner.
- Cover the pot with a lid and let the eggs stand for eight to ten minutes (or 12 minutes for medium eggs and 18 for extra large eggs.)
- Rinse the pot with the eggs under running cold water or immerse it in an ice bath for 10 minutes. If the water becomes warm in the ice bath, drain it and add more ice water. The point is to cool the eggs as quickly as possible so they will stop cooking.
- Drain the eggs and store in the refrigerator.
How Long Do Boiled Eggs Stay Fresh?
Eggs are a delicious and versatile protein snack, from devilled eggs to sliced eggs in a green salad. Once hard-boiled, eggs don’t last as long as raw eggs in the fridge because the cooking process breaks down the shell’s protective coating. This makes it easier for bacteria to enter and rot the egg. In general, they last about a week. Pro tip: Write the date they were boiled on the shell or container of the cooked eggs. But it’s also good to trust your gut — and your nose — when it comes to determining if they have turned or not.
First, you should make sure they are cooked and stored in an airtight container.
“Hard-boiled eggs should be refrigerated within two hours of cooking and discarded if left out for more than two hours at room temperature,” said Emily Rubin RD, LDN at Thomas Jefferson University Division of Gastroenterology and Hepatology.
Plus, she adds you should leave the shells on the eggs and only peel them right before eating. This retains the best taste and quality. 
Rubin recommends smelling the eggs to make sure if they are still good. If they reek of sulfur, get rid of them. But this isn’t foolproof. “Of course, smell may be hard to determine because hard-boiled eggs already have a strong smell,” Rubin said. “But basically you want to discard any eggs with an unusual smell.”
She adds that discolored eggs should also be discarded, although the green ring around the yolk of hard-boiled eggs is fine. But if you see dark brown or green spots on the eggs, toss them right away. Additionally, you shouldn’t freeze hard-boiled eggs; it will give the whites an unpleasant, rubbery texture.
Keep Reading: Is It Safe To Eat Potatoes With Sprouts On Them?