Water heaters die at the worst possible moment, usually with a puddle and no hot water for morning showers. Knowing what is the average cost of a new water heater including installation before yours fails turns a crisis into a planned purchase: $1,200-$2,500 for a standard tank installed, $2,500-$5,500+ for tankless.

I’ve replaced two water heaters, one planned and one very much not. Here’s what determines your price and how to choose wisely.

Tank water heaters: the standard choice

A 40-50 gallon gas or electric tank heater costs $600-$1,200 for the unit plus $400-$800 installation, totaling $1,200-$2,500 for most homes. Gas units cost more upfront but less to run; electric is simpler to install. Lifespan: 8-12 years, and the anode rod is the secret to reaching the upper end.

Size by household: 40 gallons suits 1-2 people, 50 gallons for 3-4, 75+ for large families or big tubs. Undersizing means cold showers; oversizing wastes energy. If your current size worked, replace like-for-like and skip the analysis paralysis.

What is the average cost of a new water heater including installation for tankless

Tankless (on-demand) units run $1,000-$2,500 for the unit plus $1,500-$3,000 installation, totaling $2,500-$5,500+. Installation costs more because gas tankless often needs larger gas lines and special venting; electric whole-house tankless may need panel upgrades.

The payoff: endless hot water, 20+ year lifespan, 30-40% energy savings, and wall-mounted space savings. The catch: the payback period is long (often 10+ years), and they need annual descaling in hard-water areas. Tankless makes sense for long-term homes and endless-hot-water lovers; it’s a luxury upgrade, not a money saver short-term.

What drives the quote up or down

Code upgrades are the silent budget item: new installations often require expansion tanks ($100-$200), updated venting, drain pans, and sometimes earthquake strapping. Permit costs ($50-$200) apply in most areas. These aren’t upsells; they’re code.

Access matters: heaters in tight closets or attics cost more to swap. Switching fuel types (electric to gas) or locations adds hundreds to thousands. Emergency after-hours replacement adds premium pricing, which is why knowing your heater’s age and planning replacement at year 10-12 saves real money. Check the serial number; the manufacture date is encoded in it.

Extending life and timing replacement

Flush sediment annually (or at least every couple years); sediment buildup is the number one killer of tank heaters. Test the pressure relief valve yearly, and inspect the anode rod at year 5; replacing a $30 anode rod can double the tank’s life. These 30-minute maintenance tasks are the best ROI in plumbing.

Replace proactively at 10-12 years rather than waiting for failure. A planned replacement lets you shop quotes and choose your timing; a failed tank means emergency pricing and water damage. Put a drain pan with a plumbed drain under the new unit, and consider a $50 water alarm. Cheap insurance against the 2 a.m. flood.

Water heater wisdom

  • Know your heater’s age: Serial numbers encode manufacture date. Plan replacement at 10-12 years, not at failure.
  • Flush annually: Sediment is the top killer. A yearly flush dramatically extends tank life.
  • Check the anode rod: A $30 rod replacement at year 5 can double the heater’s lifespan.
  • Size correctly: 40 gal for 1-2 people, 50 for 3-4. Match your household, not your aspirations.
  • Get 3 quotes: Installed prices vary widely. Planned replacement lets you shop; emergencies don’t.
  • Add a water alarm: $50 for flood warning. The cheapest insurance against water damage.

Water heater mistakes

  • Waiting for failure: Emergency replacements cost more and often include water damage. Replace proactively.
  • Ignoring the anode rod: The sacrificial rod is the lifespan secret. Neglecting it halves the heater’s life.
  • Wrong sizing: Undersized means cold showers; oversized wastes energy for a decade.
  • Skipping code upgrades: Expansion tanks and proper venting aren’t optional. They’re safety equipment.
  • No drain pan: A $30 pan with a drain prevents thousands in flood damage. Inexcusable to skip.

The anode rod: your heater’s secret lifespan

The sacrificial anode rod corrodes so your tank doesn’t; it’s the reason tanks last a decade instead of three years. Checking it at year five and replacing it ($30, 30 minutes) can double the heater’s life. Yet almost no homeowners know it exists.

Signs of a spent anode: rotten-egg smell in hot water (bacteria reacting with the rod) or visible heavy corrosion when inspected. Replacement rods come in segmented versions for low-clearance installations. This single maintenance item is the best-kept secret in plumbing.

Water heater replacement: your questions answered

How do I know my water heater is failing?

Rusty water, rumbling sediment sounds, water around the base, inconsistent temperatures, and age over 10 years. Multiple symptoms together mean replacement is near. Don’t wait for the flood; plan the replacement on your schedule.

Gas or electric water heater: which is better?

Gas heats faster and costs less to run but more to install (venting). Electric is simpler, cheaper to install, but slower to recover and pricier to operate. Heat pump hybrids are the efficiency kings where climate and space allow.

What size water heater do I need?

40 gallons for 1-2 people, 50 for 3-4, 75+ for large families or big soaking tubs. Undersizing causes cold showers; oversizing wastes energy for a decade. Match your household’s actual peak demand.

Can I install a water heater myself?

Physically possible, legally restricted in many areas (permits and codes apply), and risky with gas lines. Most homeowners should hire a licensed plumber; the $400-$800 installation buys code compliance, warranty validity, and safety. DIY gas work is never worth the risk.

The bottom line

Budget $1,200-$2,500 installed for a standard tank, $2,500-$5,500+ for tankless. Maintain with annual flushes and anode rod checks, replace proactively at 10-12 years, and get multiple quotes on your schedule, not the emergency plumber’s. The cheapest water heater is the one you plan for. You might also like best energy-efficient upgrades for an older home and how to winterize your home to prevent frozen pipes. The DOE’s water heating guide has authoritative detail on this topic.