There are a number of considerations to take into account when buying a water heater, to ensure that you get the model best suited for your needs and that you purchase a cost-efficient model. Ideally, you should start thinking about water heater replacement before your existing model fails, so that when the time comes, you know what you want and do not find yourself buying a second choice water heater. By purchasing the right unit for your needs and taking good care of it, you can ensure that you will have enough hot water when you need it.
The first thing to do is to look at your needs. The number of people living in a home is an important factor, as is the number of bathrooms in the house. Also take into account appliances like dishwashers and laundry facilities, as these will drive your water usage up. Try to estimate what your peak water usage is: if someone is showering while the dishwasher is running and someone starts a load of laundry, for example. Once you know what your needs are, you can think about the two major decisions you need to make: what type of fuel to use, and what kind of water heater to get.
There are four primary fuel choices, depending on where the heater is being installed. Electric heaters are quiet and energy efficient, but can be costly to run because electricity is expensive in many regions. Gas water heaters tend to be cheapest to run, and they heat water relatively quickly, while oil heaters heat the water very rapidly, but are also very heavy, because of the thick tank lining needed. Finally, you may want to consider installing a solar water heater. Although these heaters can be more expensive at time of installation, they pay for themselves over time, and can also be used in tandem with a regular hot water heater for peak demand, if necessary.
You also have two choices when it comes to the water heater itself. You can purchase a tank water heater, which keeps a reserve of water heated at all times, or an on-demand water heater, which heats water as needed. As a general rule of thumb when purchasing a tank water heater, a one bathroom home needs a 30-40 gallon (114-151 liters) water heater, while a two to three bathroom house needs a 50 gallon (189 liter) tank at a minimum. An on demand heater is much more energy efficient, especially when combined with a solar system, but it does have limitations: make sure to check on how much water an on demand heater can produce when it is needed, as you may not be able to run multiple baths and appliances on a single on demand heater.
Once you have decided the fuel and type, you can start looking at water heaters that meet your needs. Check the energy guide label first, because that will tell you how much how water can be produced at peak demand, and how much money, roughly, the water heater will cost to run each year. This label will also have information about the energy factor. A water heater with an energy factor of one would be able to get hot water heater to the tap without any loss of energy, and is currently only a dream, but you do want a water heater with an energy factor as close to one as possible. While looking at water heaters, check to see what they are heavily insulated and find out what they are made from. Most hot water heaters have metal exteriors and ceramic linings, which tend to corrode more quickly, but are adequate unless you have very corrosive water. If you know your water is corrosive, get a stainless steel water heater, even though it will be more expensive.
When you install the water heater, make sure that all safety measures are followed. Most water heaters have a scald protector to prevent burning, so make sure it is installed and set properly. Also install a heat trap, to prevent hot water from going back up the intake pipe, and if your water heater is fueled by gas or oil, install ventilation that conforms with local building codes. Install a temperature/pressure relief valve, which will relieve pressure on the water heater and keep it from exploding if it gets too hot. Gas and oil heaters should be elevated from the floor to prevent combustion, and your tank should be drained and cleaned once a year to remove sediment.