In general electric tank water heaters are cheaper and have a lower cost of installation than gas water heaters; however the annual price of operation is more than their gas counter parts. On average an electric water heater cost $505 compared to the $360 annual operation cost of gas water heaters. Given that electric water heaters have no pilot light they are quieter and in general safer than gas water heaters. Since electric water heaters use less parts than gas water heaters they tend to have longer lives than gas water heaters, however if an electric water heater breaks down replacement parts are more expensive than gas water heaters.
It takes less energy to heat up water with gas than electricity, therefore in general gas water heaters are more energy efficient than electric water heaters, and as mentioned before have a lower annual operational cost. Gas water heaters heat water faster and have a faster recovery time than electric; this should be taken into consideration when assessing your household demand for hot water. In contrast to electric water heaters, gas water heaters work even if there is a power outage. A clear advantage that gas water heaters have over their electric counter parts is that they tend to not break down as easily as electric water heaters and in the case they do break down repair cost are cheaper.
Tankless Water Heaters also known as on-demand water heaters are a great way to save energy. When you install a tankless water heater the water is flash heated as you are using it. When the hot water is not being used, tankless water heater stops heating the water giving you better efficiency while saving energy. Tankless water heaters can last more than 20 years. So the energy and replacement savings usually outweighs the initial cost.