Abstract: A tankless hot water heater includes a pipe, at least one heating element, sensors, an input means and a microprocessor. The pipe has an inlet and an outlet. The at least one heating element is configured to heat water flowing through the pipe. At least one sensor is configured to measure a temperature of water flowing through the pipe prior to heating by the at least one heating element. At least one sensor is configured to measure a flow rate of water flowing through the pipe. The input means is configured for entering a set point for a temperature of water heated by the at least one heating element. The microprocessor is configured to receive as input the temperature of water flowing through the pipe prior to heating, the flow rate of water flowing through the pipe, and the set point for a temperature of heated water, and the microprocessor is configured to provide as output a power setting to the one or more heating elements.