Electric water heaters are typically cheaper to purchase and install, but gas heaters tend to be more energy-efficient in the long run.