Why is the yolk of my hard-boiled egg turning green?

Have you ever peeled a hard-boiled egg only to discover, to your horror, a thin green border around the yolk? Let’s face it, we’ve all had that moment of doubt: “Is it still good?” Rest assured, your eggs are neither expired nor spoiled. This phenomenon, while unsightly, has a very simple explanation… and, more importantly, an easy solution to avoid it forever!
Why does this greenish ring appear?

It’s a small chemical reaction that’s behind this strange color. When eggs are cooked for too long or at too high a temperature, the iron in the yolk reacts with the sulfur in the white. The result: a compound called iron sulfide forms, leaving this greenish-gray ring around the center of the egg.