Tank water heaters: size by first-hour rating
The number that matters is the first-hour rating (FHR) — how many gallons of hot water the heater can deliver in an hour, starting with a full tank. It's on the yellow EnergyGuide label as "Capacity (first hour rating)". Pick a tank whose FHR is at least your peak-hour demand.
Find your peak-hour demand
Think of the one hour when your household uses the most hot water — often the morning rush. The Department of Energy's worksheet counts 20 gallons per shower, 2 per shave, 3 for hand dishwashing or food prep, 7 per dishwasher load, 25 per top-loading washer load and 15 for a front-loader. Three showers, a shave and some dishes come to 65 gallons — so you'd look for an FHR of 65 or more.
Why the same tank size rates differently
Gas burners heat water faster than electric elements, so a 40-gallon gas tank usually has a higher first-hour rating than a 50-gallon electric one. Heat pump water heaters are the most efficient but recover slowly; their FHR is in the maker's literature, since they don't always carry an EnergyGuide label. The typical ratings in the planner are midpoints — always check the model you buy.
Tankless: size by flow and temperature rise
Add up the flow of every fixture you might run at once, in gallons per minute. Then find the temperature rise: your target temperature minus the incoming water temperature. DOE suggests assuming 50 °F incoming water if you don't know it, which means a 70 °F rise for 120 °F hot water. A shower and a bathroom faucet at once need about 3 gpm at that rise.
Gas tankless units typically deliver a 70 °F rise at about 5 gpm; electric units at about 2 gpm. A whole-house electric unit can draw well over 100 amps, so check your electrical panel before choosing one.
Set it to 120 °F
120 °F is hot enough for most homes and lowers both scalding risk and energy use. Use 140 °F only for an appliance that needs it, such as a dishwasher without its own heater, and add an anti-scald valve.
Sources: U.S. Department of Energy — sizing a new water heater.