Tankless water heaters tend to last 2 times as long as a tank water heater.
While a tank water heater may last 8 to 12 years a tankless water heater can last as long as 15 years to 20 years and even 25 years.
The tankless water heater also heats the water only when being used and so it saves on energy and there's not tank that can rupture and leak.
You always have hot water without running out which is one of the major advantages of tankless water heaters.
The age that you should replace a tank water heater is between 8 years to 12 years.
However some tank water heaters can last longer and some may need replaced sooner.
After 8 years you should be thinking about replacing the tank water heater eventually and after 12 to 15 years it's best to replace it before it does fail.
How well the water heater is maintained, how often the water heater is flushed out, the quality of the water heater and the location and quality of the water can also affect the lifespan of a water heater.
Hard water can cause more sediment buildup in the water heater and cause it to fail sooner.
Water heaters can last 20 years and sometimes longer.
Most newer water heaters only last around 10 to 15 years and if you get more than 10 years out of a newer water heater then you're doing good.
Some older water heaters can work for several decades.
I have an electric water heater that is 45 years old as of now and it still is working good.
I'm planning to replace it soon due to not trusting it much longer.
However it may last longer than that.
Ideally though you should plan on replacing your water heater within 10 years just to be safe.
Even if it still is working and not leaking it could rupture at anytime and it's better to replace it before it causes more costly damage to your house.
You should also put aside some money to take care of future repair costs and replacement costs of water heaters and other appliances in the home.
Also be sure to drain the water heater yearly with a hose and flush it out to remove any sediment build up which can extend the lifespan of the water heater.