Water heaters may produce a foul smell when microorganisms in water react with magnesium sacrificial anodes, producing a hydrogen sulfide gas that creates an odor similar to that of rotten eggs. This problem occurs most often in well heaters and is not the responsibility of the water heater's manufacturer.
For an inexpensive solution, individuals can shut off the cold water valve to the water heater, drain water from the tank by turning on a hot faucet and pour several pints of hydrogen peroxide into the tank. After one to three hours, all hot water faucets should be opened to cleanse drain pipes, and the rest of the solution can be drained through the heater drain valve. The tank should then be filled with cold water before being flushed again. Individuals should only attempt this procedure if they are familiar with the functions of the water heater. If the odor returns, individuals can replace a magnesium anode rod with one of zinc or aluminum, or they can use an instantaneous or plastic-lined water heater in place of a standard model.
Individuals should avoid softening foul-smelling water, which tends to aggravate the problem. Although some plumbers suggest removing the anodes altogether, this generally voids the manufacturer warranty and causes the water heater to rust faster.