Friday, October 16, 2026
The Plumbing Brief
Independent plumbing intelligence
Subscribe · Free
How-To

How a Water Heater Works

By The Plumbing Brief Editorial Team · · Last reviewed: September 2026
A cutaway of a tank water heater showing internal parts

A water heater works by feeding cold water to the bottom of an insulated tank, heating it with a gas burner or electric elements, and pushing it out the top on demand.

Key Takeaways

  • Cold water enters through a dip tube that delivers it to the bottom of the tank; heated water rises and leaves through an outlet at the top (U.S. DOE Building Science Education).
  • A thermostat holds the water at a set point; the U.S. Department of Energy recommends 120 degrees Fahrenheit to balance comfort, safety, and standby energy loss (U.S. DOE).
  • The anode rod is a sacrificial magnesium or aluminum rod that corrodes in place of the steel tank; once it is spent, the tank starts to rust.
  • The temperature and pressure (T&P) relief valve opens at about 210 degrees Fahrenheit or 150 psi to keep the tank from rupturing (Watts).
  • Gas heaters recover a drained tank faster than electric because a burner adds heat quicker than resistance elements (U.S. DOE).
  • A tankless (demand-type) heater has no tank and heats water only as it flows, avoiding standby loss; tanks last about 10 to 15 years, tankless units more than 20 (U.S. DOE).

How does a water heater work?

A storage water heater keeps a tank of water hot and ready. Cold water enters through a dip tube that carries it to the bottom, where a gas burner underneath or electric elements inside heat it. A thermostat holds the water at a set temperature, and because hot water rises, the hottest water sits at the top and leaves through the outlet the moment you open a tap. Fresh cold water refills the bottom to be heated next. This constant cycle of refilling and reheating raises a common question worth exploring, since water heater recovery time varies widely between gas, electric, and tankless models.

Both gas and electric storage units share this same layout: a dip tube, a heat source, a thermostat, an anode rod, a relief valve, and a drain, per the U.S. Department of Energy list of consumer water heater parts. The difference is how the heat gets in, which we cover below.

120°F
Setting the DOE recommends for most homes
U.S. DOE
210°F / 150 psi
Temperature or pressure the T&P valve opens at
Watts
10-15 yr
Typical life of a storage tank water heater
U.S. DOE
20+ yr
Life a tankless unit can reach
U.S. DOE
60 min
Window the first-hour rating measures delivery over
U.S. DOE

What are the main parts of a water heater?

A storage water heater has eight core parts, each doing one job in the cycle. The table lists what each part does and the failure that sends it to the top of a service call. Knowing the parts turns a vague symptom, like lukewarm water or a puddle, into a specific suspect.

Part What it does What goes wrong
Cold water inlet and dip tube Carries incoming cold water down to the bottom of the tank so it does not mix with the hot water at the top A cracked or broken dip tube dumps cold water at the top, so hot water runs short and lukewarm
Hot water outlet Draws the hottest water from the top of the tank out to the house Mineral scale or a loose nipple can restrict flow or leak at the connection
Gas burner or electric elements Adds heat: a burner fires under the tank, or one or two elements heat from inside A fouled burner, a failed element, or tripped high-limit leaves you with no or partial hot water
Thermostat Senses water temperature and switches the burner or elements on and off to hold the set point A miscalibrated or dead thermostat gives water that is too hot, too cold, or never heats
Anode rod Sacrificial magnesium or aluminum rod that corrodes in place of the steel tank Once fully consumed, the tank itself corrodes and eventually leaks; a rotten-egg smell can also appear
T&P relief valve Safety valve that vents water if the tank overheats or overpressurizes Can leak when worn, or stick shut if never tested, removing the tank’s last safeguard
Drain valve Lets you empty the tank to flush sediment or replace the unit Plastic valves clog with sediment or drip after use
Thermocouple or flame sensor (gas) Confirms the pilot or burner flame is lit and shuts off gas if it is not A dirty or failed sensor drops the flame, so a gas heater stops making hot water

Anatomy of a storage tank water heaterCold water inletDip tube (cold to bottom)so hot stays at the topThermostatGas burner orelectric elementsHot water outletT&P relief valveAnode rod (sacrificial)Drain valve

How does the heat cycle work, step by step?

The heat cycle is a loop that runs every time you draw hot water and whenever the tank cools below its set point. It moves cold water in at the bottom, adds heat, stratifies the hot water to the top, and sends it out on demand. Here is the sequence in a storage tank:

  1. You open a hot tap, and water pressure pushes the hottest water out of the outlet at the top of the tank.
  2. Cold water flows in through the inlet and down the dip tube, landing at the bottom so it does not dilute the hot layer above.
  3. The thermostat reads the drop in temperature at the bottom and switches on the gas burner or electric elements.
  4. Heat transfers into the water; because warm water is less dense, it rises and the tank naturally stratifies hot-on-top, cold-on-bottom.
  5. When the thermostat sees the set point again, usually near 120 degrees Fahrenheit, it shuts the heat off and the full tank waits for the next draw.

Between draws, an idle tank slowly loses heat through its walls, called standby loss, and the burner or elements kick on to top it back up, per the U.S. Department of Energy. That standby loss is the energy penalty a tank pays that a tankless unit avoids.

How does a gas water heater differ from an electric one?

The split is the heat source. A gas water heater burns fuel in a burner below the tank; the flame heats the bottom and hot combustion gases pass up through a center flue and vent outdoors. An electric water heater has no flame or flue and instead runs one or two resistance elements that sit inside the tank and heat the water directly.

That difference drives recovery rate, the speed a heater reheats a drained tank. Gas burners add heat faster, so a gas unit generally recovers quicker than a comparable electric one, per the U.S. Department of Energy. Gas models also need combustion air and venting and add a thermocouple or flame sensor for safety, while electric models are simpler to install but slower to reheat. Weigh those installation tradeoffs against long-term upkeep by learning how the anode rod protects your tank from corrosion over time. Check the anode rod maintenance guide before exploring hot water recirculation pump setup to cut wait times at the tap. Once wait times are under control, pairing this with proper setup matters, so review the water heater installation steps for code requirements and costs.

Plumber installing gas and water lines on a wall-mounted tankless heater
A tankless unit heats water only as it flows through its exchanger.

How does a tankless water heater work?

A tankless, or demand-type, water heater skips the storage tank and heats water only while it flows. When you open a hot tap, a flow sensor fires a gas burner or a bank of electric elements that raise the water temperature as it passes through a heat exchanger, per the U.S. Department of Energy. Close the tap and the heater shuts off.

Because nothing sits hot waiting to be used, a tankless unit has no standby loss and can outlast a tank, more than 20 years versus roughly 10 to 15, per the DOE. The trade-off is flow: a single unit delivers a limited number of gallons per minute, so heavy simultaneous demand can outrun it. Our tankless vs tank water heater comparison weighs the full cost and capacity trade-offs.

Plumber removing corroded anode rod near a tank's T&P relief valve
A worn anode rod and the T&P valve sit side by side on the tank.

Why do the anode rod and T&P valve matter most?

These two parts protect the tank and the people near it, and both fail quietly. The anode rod is a length of magnesium or aluminum that corrodes in place of the steel tank, because those metals give up electrons more readily than steel. As long as the rod has metal left, rust attacks it instead of the tank walls. Once it is eaten away, the tank itself begins to corrode, which is why a spent rod is one of the biggest reasons a heater leaks and fails early.

The temperature and pressure relief valve is the tank’s safety backstop. If a thermostat sticks and the water overheats, pressure climbs fast, and a sealed tank of superheated water can rupture violently. The valve opens at about 210 degrees Fahrenheit or 150 psi and dumps water down a discharge pipe to release the pressure, per manufacturers such as Watts. It should be piped to a safe spot and never capped.

How do you keep a water heater working?

Two habits keep the cycle healthy: draining sediment and checking the anode rod. Sediment from hard water settles on the tank bottom, insulates the burner, and makes a gas unit rumble as it works harder to heat through the layer. A periodic flush clears it; our guide to flush the sediment out walks through the steps and how often to do it.

If a unit stops making hot water, the fix depends on the type: a gas heater points to the pilot, thermocouple, or gas valve, while an electric one points to an element or thermostat. Our no hot water troubleshooter narrows it down, and for leaks, noise, or a failing tank, our water heater repair guide covers repair-versus-replace.

How we sourced this

Component names and the shared gas-and-electric layout come from U.S. Department of Energy resources on consumer water heaters and gas storage water heaters (DOE Building Science Education). The 120 degree Fahrenheit recommended setting, standby loss, gas-versus-electric recovery, the roughly 10-to-15-year tank life, the 20-plus-year tankless life, and how demand-type heaters fire on flow all come from DOE Energy Saver guidance. The 210 degree Fahrenheit and 150 psi T&P valve trip points are standard residential-valve specifications published by manufacturers such as Watts. The sacrificial magnesium or aluminum anode description reflects established manufacturer and trade practice. Retailer and contractor pages were read for context but not cited for figures; nothing here is estimated or invented.

Frequently asked questions

How does a water heater work?

A storage water heater feeds cold water through a dip tube to the bottom of an insulated tank, heats it with a gas burner or electric elements, and holds it at a set temperature until a tap opens. Hot water then rises and exits from a pipe at the top, while fresh cold water refills the bottom to be heated in turn.

What are the parts of a water heater?

A storage tank has a cold water inlet and dip tube, a hot water outlet at the top, a gas burner or electric heating elements, a thermostat, an anode rod, a temperature and pressure (T&P) relief valve, and a drain valve. Gas models add a thermocouple or flame sensor and a flue. The U.S. Department of Energy lists these as standard on both gas and electric units.

What does the anode rod do in a water heater?

The anode rod is a sacrificial metal rod, usually magnesium or aluminum, that corrodes in place of the steel tank. Because those metals give up electrons more readily than steel, rust attacks the rod first. Once the rod is spent the tank itself starts to corrode, so many plumbers check it every few years to extend the heater’s life.

What does the T&P valve do on a water heater?

The temperature and pressure relief valve is a safety device that opens if the tank overheats or overpressurizes. Standard residential valves open at about 210 degrees Fahrenheit or 150 psi, per manufacturers such as Watts, venting hot water down a discharge pipe to relieve the tank. Without it, a runaway heater could rupture, so the valve should never be capped or plugged.

What temperature should a water heater be set to?

The U.S. Department of Energy recommends a 120 degree Fahrenheit setting for most homes. That is hot enough for washing and showering while limiting scald risk, mineral buildup, and standby energy loss. Some households raise it slightly for dishwashers or to control bacteria, but higher settings speed up sediment and corrosion and raise the burn hazard at the tap.

How does a tankless water heater work?

A tankless, or demand-type, water heater has no storage tank. When you open a hot tap, a sensor detects the flow and fires a gas burner or electric element that heats the water as it passes through, per the U.S. Department of Energy. When the tap closes the heater shuts off, so there is no standby loss from keeping a full tank hot around the clock.

How long does a water heater last?

A conventional storage tank water heater typically lasts about 10 to 15 years, while a tankless unit can run more than 20 years, per the U.S. Department of Energy. Water hardness, sediment buildup, and a neglected anode rod shorten a tank’s life, so flushing sediment and checking the rod help a unit reach the upper end of that range.

The Plumbing Brief Editorial Team, independent plumbing trade reporting. Last reviewed: September 2026.