A rotten-egg smell that only shows up when you run the hot water is almost always hydrogen sulfide gas being made inside your water heater. The tank has a metal rod that corrodes on purpose to save the steel, and in water carrying sulfate and the right bacteria, that rod feeds a reaction that turns sulfate into the gas that smells like rotten eggs. It is common on well water and worse on softened water, and the fix is well understood. The one thing worth reading first is the difference between a smell in the water and a smell in the air, because a rotten-egg smell hanging in the room can be a natural-gas leak, and that is an emergency, not a plumbing job.
Key takeaways
- A sulfur smell in the hot water only points at the water heater, not your supply.
- The cause is hydrogen sulfide gas from sulfate-reducing bacteria reacting with the magnesium anode rod.
- The lasting fix is the anode: aluminum-zinc for most homes, a powered anode for softened water.
- Sanitizing the tank with chlorine or peroxide clears the smell fast but does not keep it gone alone.
- A rotten-egg smell in the air, not the water, may be natural gas. Leave and call the gas utility.
Rotten eggs in the hot water is a bacteria-and-anode problem you can fix. Rotten eggs in the air is a gas leak until proven otherwise. Sort which one you have first.

First, is it the water or the air?
Before you order an anode rod, settle one question, because two very different problems share the same smell. Hydrogen sulfide from your water heater rides in the water and reaches your nose when you run a hot tap. Mercaptan, the odorant in natural gas, hangs in the air whether or not any water is running. Both smell like rotten eggs. If the smell is in the room, especially if it gets stronger as you walk toward the heater or the gas line, stop and treat it as a possible gas leak, covered below. If the smell is clearly in the water when you run hot, you are in water-heater territory and the rest of this page is for you.
Once you know it is the water, narrow it with a test that costs nothing. After the house has gone a few hours without anyone using water, run a hot tap and smell it, then a cold tap. If only the hot water carries the odor, the smell is being made in the heater and the anode rod is the suspect. If both hot and cold smell, the hydrogen sulfide is coming in with your supply, a well or water-treatment problem that no anode swap in the heater will fix.
Why the tank makes the smell
Every steel water heater tank has a sacrificial anode rod threaded into the top, a rod of reactive metal, usually magnesium, that corrodes in place of the steel so the tank does not rust through. The trouble starts when the water carries sulfate, which well water often does, and a colony of sulfate-reducing bacteria. These bacteria are anaerobic, so the inside of a sealed tank of standing warm water suits them, and they are most active in the 70 to 120 degree range that overlaps with where a lot of tanks run. Given sulfate to feed on and a magnesium anode supplying electrons, they convert the sulfate into hydrogen sulfide gas, which dissolves in the hot water and comes out at the tap smelling like rotten eggs.
Two things make it worse. Well water tends to carry more sulfate than treated city water, so wells see the problem more often. And a water softener speeds up the corrosion of the magnesium anode, so a house that never smelled can start smelling after a softener goes in. None of this means your tank is failing. It means the chemistry inside it favors the bacteria, and you change the chemistry to stop the smell.
The bars above rank the anode options by how well they knock down the smell, not by how well they protect the tank. Read them as relative odor performance, since the exact result depends on your water. Magnesium protects the steel best and smells the worst. A powered anode has no sacrificial metal at all, so there is nothing for the bacteria to react with and no smell, which is why it sits at the top.
The three fixes, in the order to try them
There are three levers, and they do different jobs. Sanitizing the tank kills the bacteria in there now and clears the smell fast, but it does not stop the colony from rebuilding. Changing the anode changes the chemistry so the reaction slows or stops, which is the durable repair. Raising the temperature keeps the bacteria knocked back but brings a scald tradeoff. Most jobs use sanitizing for speed and an anode change for the fix.
Sanitizing the tank: chlorine or peroxide
Sanitizing is the fast reset. Turn off the power at the breaker for an electric unit, or set a gas unit to pilot or off, then shut the cold inlet and drain the tank. Chlorine bleach is the stronger disinfectant. A shock treatment for a tank runs 50 to 100 parts per million of free chlorine, which for standard household bleach at about 5.25 percent is a few ounces to a pint depending on tank size, added and then circulated through the hot lines by opening each hot tap until you smell chlorine. Let it sit several hours, ideally overnight, using no water, then drain and flush until the chlorine is gone. One catch: chlorine loses effectiveness fast in high-pH water, so hard alkaline water needs more of it, and the hydrogen sulfide and iron already in the water eat into the dose too.
Hydrogen peroxide is the gentler option and leaves no chlorine residual. A common recipe is one to two pints of ordinary 3 percent peroxide per 40 gallons of tank, poured in, filled, and left about two hours before you drain and flush. It is easier on the plumbing and skips the strong chlorine smell. Whichever you use, the principle is the same: kill what is living in the tank now, then flush it clean.
- Gas leak first: rotten-egg smell in the air, not the water. Leave the building, no switches, flames, or phones inside.
- Kill power at the breaker (electric) or set the gas control to pilot or off before draining.
- Handle bleach in a ventilated space, wear gloves and eye protection, and never mix bleach with anything else.
- Circulate the sanitizer through every hot tap, then let it sit hours before flushing clean.
- Flush until the chlorine or peroxide smell is fully gone before you drink or cook with the hot line.
- Cold water also smells, or the smell returns fast after an anode change: test and treat the supply, not the tank.
- Keeping the tank at 140 F or hotter for odor control: install a thermostatic mixing valve to prevent scalds.
Hydrogen sulfide (H2S)
The gas responsible for the rotten-egg smell. In a water heater it is produced when sulfate-reducing bacteria, which thrive in the warm, low-oxygen tank, react with sulfate in the water and with the sacrificial anode rod. The magnesium anode is chemically active enough to drive that reaction, which is why magnesium is the rod most associated with smelly hot water. At household levels it is a nuisance odor rather than a health hazard, but in a high enough concentration in an enclosed space it is toxic.
Changing the anode: the repair that lasts
The anode rod is the fix that actually stays. Pulling the magnesium rod and replacing it with an aluminum-zinc alloy rod solves the smell for most homes on ordinary water, because the zinc does not drive the hydrogen-sulfide reaction the way magnesium does, and you keep sacrificial protection for the tank. If you are on a water softener, or if an aluminum-zinc rod does not hold, step up to a powered anode. It replaces the sacrificial metal with a low trickle of electric current, so there is nothing in the tank for the bacteria to work on and no rod to eat away. It costs more up front and needs a nearby outlet, but it lasts the life of the tank. The rod threads into the top, sometimes under a plastic cap, and comes out with a socket, though years of corrosion can make it a stubborn job worth handing to a plumber if it will not budge.
| Smell in hot water only | Made inside the heater. Anode rod plus bacteria. This page applies. |
| Smell in hot and cold water | Coming in with the supply. Well or water-treatment problem, not the heater. |
| Smell in the room air, not the tap | Possible natural-gas leak. Leave, no sparks, call 911 and the gas utility. |
| Standard magnesium anode, well water | Swap to an aluminum-zinc alloy rod. Sanitize at the same time. |
| On a water softener | Aluminum-zinc often not enough. Go straight to a powered anode. |
| Smell returns weeks after a sanitize | Anode still feeding it, or supply reseeding. Change the anode; test cold water. |
| Want it gone today to confirm | Chlorine or peroxide flush. Fast, but temporary without an anode change. |
| Keeping the tank hot for odor control | Run 140 F or above, and add a thermostatic mixing valve for scald safety. |
The gas-leak distinction, in detail
This is the part worth reading twice, because getting it wrong is the only way a smelly-water problem turns dangerous. Natural gas has no smell of its own. Utilities add a trace of mercaptan so a leak announces itself, and mercaptan smells like rotten eggs, the same broad smell as the hydrogen sulfide off your hot water, which is exactly why the two get mistaken for each other. The tell is where the smell lives. Hydrogen sulfide from the heater is in the water, so you get it at the tap when you run hot and it fades when the water is off. A gas leak is in the air, near the appliance or the gas piping, there whether or not any water is running, often getting stronger as you move toward the source.
Gas smell in the air: emergency steps
If you smell rotten eggs in the air rather than in the water, treat it as a gas leak. Leave the building right away. Do not flip a light switch, strike a match, use the stove, or use your phone inside, because a spark can ignite the gas. Once you are outside and away, call 911 and your gas utility, and do not go back in until they tell you it is safe.
None of that applies to a smell that is plainly in the water and only in the hot water. That one is a bacteria-and-anode problem you can work through at your own pace. But the cost of confusing the two runs one direction only, so when there is any doubt, assume gas, get out, and make the call.

Keeping it gone
Once the smell is fixed, keeping it away is mostly about not undoing the chemistry that fixed it. If the aluminum-zinc rod solved it, check the anode every couple of years, since a spent rod eaten down to its core wire stops protecting the tank and can let the smell creep back. A powered anode needs little beyond staying powered. On a softener, clean the brine tank once a year. And if you are on a well where the sulfate and bacteria keep coming in with the supply, the real long-term answer sits upstream of the heater, in whole-house treatment. The heater is where you smell the problem. It is not always where it starts.
Frequently asked
Why does my hot water smell like rotten eggs but the cold water is fine?
That split is the whole diagnosis. When only the hot side stinks, the smell is being made inside your water heater, not carried in with the supply. The tank holds a sacrificial anode rod, usually magnesium, that corrodes on purpose to protect the steel. In water that carries sulfate and a colony of sulfate-reducing bacteria, that magnesium feeds a reaction that turns sulfate into hydrogen sulfide gas, and hydrogen sulfide is what rotten eggs smell like. If the cold water also smells, the source is your well or supply line instead, which is a water-treatment problem rather than a heater problem. Run the away-from-home test first: after nobody has used water for a few hours, sniff a hot tap and a cold tap and see which one carries the odor.
What is the fastest fix for a rotten-egg smell in hot water?
There is no single fastest fix that also lasts, so match the move to how bad it is. To get the smell gone today, sanitize the tank: turn the power or gas off, drain it, run a chlorine or hydrogen-peroxide flush through it, let it sit, then flush clean. That kills the bacteria and clears the odor, but it returns over weeks or months if nothing else changes, because the bacteria repopulate. The durable fix is the anode rod. Pull the magnesium rod and put in an aluminum-zinc alloy rod, and for most homes on regular water that ends it. If you have a water softener or the aluminum-zinc rod does not hold, a powered anode is the reliable answer, since it protects the tank with a trickle of current and has no sacrificial metal for the bacteria to work on. Sanitize first for speed, change the anode for the fix that stays.
Which anode rod stops the smell, magnesium, aluminum-zinc, or powered?
Ranked by how well they kill the odor: powered is best, aluminum-zinc is next, and magnesium is the worst offender. Magnesium is the most chemically active of the three, which makes it best at protecting the steel tank but also the one that most readily feeds the bacteria that make hydrogen sulfide. An aluminum rod alloyed with zinc solves the smell in most homes, because zinc does not drive the reaction the way magnesium does, and you still get sacrificial protection. A powered, or impressed-current, anode uses a small electric current instead of a sacrificial metal, so there is nothing for the bacteria to react with and no odor at all. It costs several times what a rod costs, but it lasts the life of the tank and holds up on softened water, where an aluminum-zinc rod often is not enough.
When is a rotten-egg smell actually a gas leak instead of the water?
When you smell it in the air of the room, not in the water at the tap. Gas utilities add a chemical called mercaptan to natural gas so a leak announces itself, and mercaptan smells like rotten eggs, the same family of smell as hydrogen sulfide, which is exactly why the two get confused. The difference that matters: the water-heater smell rides in the hot water and shows up when you run a hot tap, while a gas leak hangs in the air near the appliance or the gas line whether or not any water is running. If you smell rotten eggs in the room, especially getting stronger near the heater, leave the building, do not flip any switch or light a flame or use your phone inside, and once you are outside and away, call 911 and your gas utility. Do not go back in until they say it is safe.
Does turning up the water heater temperature get rid of the smell?
It helps, because the bacteria that make hydrogen sulfide are killed at water temperatures at or above 140 degrees Fahrenheit, and running the tank at 160 for several hours knocks them back hard. That makes it a legitimate tool, either as a periodic reset when the smell creeps back or alongside an anode change. The catch is scald risk, and it is not small. At 131 degrees a bad burn takes about five seconds of contact, and at 160 you are into second and third-degree burns in a fraction of a second, dangerous with kids or older adults in the house. If you keep the tank hot for odor control, add a thermostatic mixing valve so the water delivered to the taps is tempered back to a safe temperature while the tank stays hot enough to stay clean. Cranking the dial and leaving it is the wrong way.
Can a water softener make the rotten-egg smell worse?
Yes, and it catches people off guard because they installed the softener to improve their water. Softened water speeds up the corrosion of a magnesium anode, which means more of the reaction that produces hydrogen sulfide, so a house that never had a smell can start stinking after a softener goes in. The brine tank is also a comfortable home for sulfate-reducing bacteria, so cleaning it once a year helps. The practical point is that on softened water the usual aluminum-zinc swap often does not fully solve the odor, and the reliable fix becomes a powered anode. Budget for it rather than working down the list of cheaper rods.