If you want to save the most money(energy), get a hy-brid water heater with a heat-pump mounted on top. They cost about the same as a tankless gas water heater. There is also a conversion kit one company makes(Airgenerate) that allows you to mount their heat pump on your existing water heater, gas or electric. What ever you do, stay as far away from the tankless electric water heaters as you can.
If you happen to live in the northern states where heat pumps don’t work well, a heat pump water heater won’t work well either. They also need to be in an unconditioned space, like a garage.