If you peel a hard-boiled egg and notice a faint greenish-gray ring around the yolk, there is usually no reason to panic. This discoloration is caused by a natural chemical reaction between sulfur in the egg white and iron in the yolk. When eggs are exposed to high heat for too long, sulfur compounds can react with iron near the surface of the yolk, creating iron sulfide and producing the familiar greenish ring.
The ring is generally harmless and does not mean the egg is spoiled or unsafe to eat. It can sometimes be accompanied by a slightly drier or firmer yolk, particularly when the egg has been overcooked. However, normal food-safety practices still apply: eggs should be cooked properly, handled hygienically, and refrigerated when appropriate.
Overcooking is the main reason this green ring develops. Boiling eggs vigorously for too long increases the chemical reaction that produces the discoloration. Older eggs may also be more likely to develop the ring because changes in pH can affect how sulfur compounds move within the egg.
Fortunately, the discoloration is easy to prevent. Avoid cooking eggs for longer than necessary, and cool them promptly after cooking to stop the cooking process. Placing freshly cooked eggs in cold or ice water can help. The next time you see a green ring around an egg yolk, remember that it is usually a harmless result of food chemistry rather than a sign that something has gone wrong.