Nearly all modern water heaters contain from one to five sacrificial anodes — rods of magnesium or aluminum installed to protect exposed steel within through a slow electrolytical reaction.
In the photo at left, the righthand one is brand new. The lefthand one is exactly the same except that it sat in a water heater for seven years. Not much left, eh? Well, that’s its job: to go away, while protecting the tank it sits in. Both are of the hex type, which are used in most water heaters.
Likely you’ve never heard of anodes, even though they’re a common item in marine applications. There, they’re known as “zincs.” That may ring a bell with some reading this. Same principle.
The one on the right is a combo anode/hot-water outlet/pipe nipple, and is found on many residential Bradford White heaters and some made by State and A.O. Smith. It screws into the hot port.
When six inches of core wire is bare, an anode should be replaced. These are all magnesium rods. The corrosion is usually gritty, while aluminum ones tend to be kind of slimy.