Why do hard boiled eggs turn green?

Hard-boiled eggs don't usually turn green. However, if the egg yolk of a hard-boiled egg turns greenish, it is most likely due to a chemical reaction between the iron in the yolk and the sulfur in the egg white. This reaction is accelerated by high heat and long cooking times, which is why it is more common in overcooked eggs. The greening of the egg yolk is not harmful, but it can affect the taste and appearance of the egg. To prevent the egg yolk from turning green, cook the eggs for the recommended amount of time and cool them immediately in cold water after cooking.