On average, the cost to replace a 40 gallon water heater starts at $1300.