Replacing a standard 40 to 50 gallon tank water heater typically runs about $900 to $2,500 installed, with gas units costing more than electric because of venting and gas line work. Tankless replacements commonly land between $1,400 and $5,600 installed. Your final number depends on fuel type, capacity, and any code upgrades the swap triggers.
What it costs to replace a water heater
There is no single price, so treat these as typical industry ranges rather than a quote. The two biggest swings are the type of heater and whether your installer has to add venting, gas, or electrical work to bring the job up to current code. A like-for-like swap of the same fuel and size sits at the low end. Switching types or upsizing pushes you toward the top.
| Heater type | Typical installed range | Notes |
|---|---|---|
| Tank, electric (40 to 50 gal) | $900 to $2,000 | Usually the cheapest swap, no venting or gas line. |
| Tank, gas (40 to 50 gal) | $1,200 to $2,500 | Higher than electric: venting and gas connection add labor. |
| Tankless, electric | $1,400 to $3,000 | May need an electrical panel upgrade. |
| Tankless, gas | $2,100 to $5,600 | Needs venting and gas work; the priciest common path. |
What drives the price up
Two installs of the same heater can differ by more than a thousand dollars. The cost drivers worth knowing before you call for a quote:
- Fuel type. Gas units cost more to install than electric because of venting and the gas connection.
- Capacity. A larger tank or a higher-output tankless unit costs more up front.
- Conversion. Going tank-to-tankless is the expensive path. A new gas line, new venting, or an electrical upgrade can add the most to any job.
- Code upgrades on a swap. A modern install may require an expansion tank, relief-valve discharge piping, a drip pan, updated venting, and permits. These are not optional extras; they are how the job passes inspection.
- Labor and region. Local rates and how hard your unit is to reach both move the number.
The gas connections and the temperature-and-pressure relief valve are pro-only work. This is not a DIY job, and the permit and inspection exist for a reason.
The maintenance that delays this cost
This is the part the cost-calculator sites skip. The cheapest water heater replacement is the one you push several years into the future. A tank heater lasts 8 to 12 years, but where it lands in that range is largely up to maintenance, and one task matters more than the rest.
- Replace the anode rod every 3 to 4 years. The anode rod is the single biggest lever on tank life. It is a sacrificial metal rod that corrodes so your tank does not. When it is used up, the tank starts to rust from the inside. Staying ahead of it is the difference between 8 years and 12. See how often to replace the anode rod.
- Flush sediment yearly. Sediment settles on the bottom of the tank, makes the burner or element work harder, and is what causes that rumbling sound. Flushing keeps it efficient and quiet. Here is how often to flush a water heater, and what the popping noise means if you are already hearing it.
- Descale a tankless unit yearly. Tankless heaters last 15 to 20 years or more, up to 25 to 30 with care, but only if you keep mineral scale out of the heat exchanger. Descale yearly, more often in hard water. See tankless water heater maintenance.
The U.S. Department of Energy recommends flushing sediment yearly and inspecting the anode rod on that 3 to 4 year cadence. None of it is glamorous, and all of it is cheaper than a new heater.
Repair or replace, by age
When a heater starts acting up, age is the deciding factor. Here is a simple framework that matches what manufacturers like Rheem and A.O. Smith publish on lifespan.
- Tank under 6 years: repair. A failed element, thermostat, or valve is a fraction of a replacement, and the tank has years left.
- Tank 6 to 10 years: judgment call. Repair small parts, but if the repair is more than half the cost of a new unit, replacing is usually the better spend.
- Tank over 10 years, or any age with a bottom leak: replace. Pooling water at the base of the tank means the tank itself has failed, and that cannot be repaired.
- Tankless under 15 years: almost always repair. These units are built around replaceable parts.
Watch for the end-of-life signs: the unit is in its age range, hot water comes out rusty or discolored, you hear rumbling or popping, you run out of hot water faster than you used to, or water is pooling at the base. A bottom leak is the clearest signal of all. Learn what a leaking water heater means before you assume the worst.
Common questions
Is a tankless water heater worth the higher cost?
It depends on how long you will stay in the home. Tankless units cost more to install, especially gas models that need venting and gas work, but they last 15 to 20 years versus 8 to 12 for a tank. Over a long enough stay, the longer lifespan and lower standby energy use can offset the higher up-front price.
Why is gas more expensive to install than electric?
Gas heaters need proper venting to carry combustion gases outside, plus a gas line connection. Both add labor and parts that an electric unit does not require. If you are converting from electric to gas, you are also paying to run a new gas line, which is why conversions sit at the top of the range.
Can I just replace it myself to save money?
No. Gas connections and the temperature-and-pressure relief valve are pro-only work, and most areas require a permit and inspection for the swap. A bad gas or venting connection is a carbon monoxide risk, and a mis-sized relief valve is a pressure risk. The labor is part of why the job is safe.
How long should a new water heater last?
A tank heater typically lasts 8 to 12 years, and a tankless unit 15 to 20 years, up to 25 to 30 with good care. Where yours lands depends on water hardness and maintenance. Keeping the anode rod fresh and flushing sediment yearly are what push a tank toward the high end of that range.
What does it mean if water is pooling under the tank?
A leak from the bottom of the tank means the tank has corroded through, and that is not repairable. Once the tank itself fails, replacement is the only fix. A small leak from a fitting or valve at the top is a different story and is often repairable, so it is worth identifying where the water is coming from before you panic.
Good maintenance rhythm
- Yearly: flush sediment from the tank, or descale a tankless unit (more often in hard water).
- Every 3 to 4 years: have the anode rod inspected and replaced on a tank heater.
- Ongoing: watch for rusty hot water, rumbling, shorter hot water runs, or pooling at the base, and call a pro early.
- At 8 to 12 years: start budgeting for tank replacement so the timing is your choice, not an emergency.